(Bloomberg) -- Nancy Pelosi reached an extraordinary bargain to seal the support she needs from dissident Democrats to return to the House speaker’s job, a dozen years after she became the chamber’s first woman leader.

The agreement to limit her time in the top job is a concession to a faction of House Democrats who’ve been agitating for a new generation of leaders to replace Pelosi and her top lieutenants to better reflect the party’s younger and more diverse base.

But it also was a demonstration of Pelosi’s skill as a deal maker. She was able to quell opposition from a group of lawmakers who campaigned against her while assuring that she could have as many as four more years in a job she relished -- until she’s 82.

“I see myself as a bridge to the next generation of leaders,” Pelosi said in a statement announcing the deal. She added that it was “a recognition of my continuing responsibility to mentor and advance new members into positions of power and responsibility.”

After Democrats won a House majority in the November election, Pelosi used a combination of pressure, persuasion and perks to whittle down her opponents. Her main argument was that she was the best person to confront Donald Trump, and she was able to make that point dramatically on Tuesday during an acrimonious exchange with the president in front of reporters and cameras.

Hard Stance

She later told colleagues she felt like she needed to be the “mom” in the room, echoing her frequent argument for the need to have a woman at the negotiating table with political leadership otherwise composed of men. Many Democrats said they were cheered by the hard stance taken by Pelosi and Senate Democratic leader Chuck Schumer in the meeting.

Representative Eric Swalwell of California, a Pelosi ally, said the sharp exchange with Trump, in which the president declared he’d take responsibility for a government shutdown, probably sealed her speakership.

“She’s the best we could send to be in the room where it happens,” the California Democrat said.

The rebel faction, mostly led by Massachusetts Representative Seth Moulton, had claimed since the election that they had enough votes to deny Pelosi the speaker’s job. Pelosi would need 218 of 234 Democrats to support her and there were at least 20 of the party’s lawmakers in opposition. The California Democrat went to work.

Awarding Promotions

Representative Marcia Fudge, an Ohio Democrat who floated the idea of challenging Pelosi, ended up endorsing her after Pelosi promised to make Fudge the chairwoman of a House elections subcommittee.

Another dissident, Representative Brian Higgins, a New York Democrat, endorsed Pelosi in exchange for a role leading a Medicare buy-in bill and a promise the House would vote on an infrastructure bill. She wooed other would-be opponents with promises of committee representation, new job titles and legislation.

Democrats also elevated three younger members, Representatives Ben Ray Lujan of New Mexico, Hakeem Jefferies of New York and Cheri Bustos of Illinois into leadership positions.

Pelosi’s agreement to go along with the plan that would allow her to remain speaker for a maximum of four years won her the backing of the most stubborn holdouts. After it was announced, Moulton and six other Pelosi critics issued a joint statement saying they would voter for her as speaker.

Generational Change

“I have pushed for new leadership because I want to see generational change in the Democratic Caucus,” Representative Ed Perlmutter of Colorado, one of the opponents, said in his own statement. “I am now convinced that generational change has started and will continue to accelerate.”

The deal to limit the top three Democratic majority leadership roles to three two-year terms, with the option for a fourth term, retroactive to previous terms in the same job, will be put to the caucus in February. While this term limit might not change Pelosi’s career plans in practice, it forced the 78-year-old to put a hard stop on her years atop the party.

It’s unclear if the proposal will pass when the Democratic caucus votes on it Feb. 15. But it doesn’t matter for Pelosi, who previously served as speaker from 2007 to 2011, because she will have already won the post and pledged to adhere to the agreement regardless.

She went ahead with the agreement against the wishes of the rest of her top leadership team.

"Uh, no," incoming Majority Leader Steny Hoyer of Maryland said Wednesday morning when asked whether he backed the deal as it was being negotiated.

Representative Jim Clyburn of South Carolina, set to become majority whip, the No. 3 job, said he also was against setting term limits.

The chairman of the Congressional Black Caucus, Representative Cedric Richmond, reaffirmed Wednesday his opposition to term limits, of any sort. The group will boast more than 50 members in the next Congress.

“If we get a great speaker, we want to put a term limit? It just doesn’t make sense,” the Louisiana Democrat said. “If we don’t like somebody, don’t vote for them. But to just put an arbitrary term limit on them is unfortunate.”

Pelosi, Hoyer and Clyburn, all in their late 70s, have led House Democrats for more than a decade. They will be presiding over a caucus that was expanded into a majority by an influx of newly elected representatives who are generally younger and more diverse than most members of Congress.

To contact the reporters on this story: Billy House in Washington at bhouse5@bloomberg.net;Anna Edgerton in Washington at aedgerton@bloomberg.net;Arit John in Washington at ajohn34@bloomberg.net

To contact the editors responsible for this story: Joe Sobczyk at jsobczyk@bloomberg.net, Justin Blum

©2018 Bloomberg L.P.