WASHINGTON –– House Democratic leader Nancy Pelosi made a term limits deal on Wednesday with dissident House Democrats, including Rep. Bill Foster, D-Ill., locking in more than enough votes to reclaim the speakership on Jan. 3.

The concession means that Pelosi, 78, the first female speaker when she took the gavel in 2007, has pledged to serve as speaker a maximum of four more years, a very small price to pay to end the impasse.

The agreement is a win for the holdout rebels, who insisted that Pelosi install some kind of transition plan in exchange for their votes. Talks with the holdouts — who numbered about 15, but enough to have leverage — have been ongoing for weeks, kicking off soon after Democrats picked up at least 40 seats in the November midterms.

Foster, who had counted himself among the “Never Nancy” members in order to pressure Pelosi to put an end date on her leadership, emerged as one of the central negotiators in what became a struggle to open up leadership spots. I’m told Foster had a lengthy talk with her on Sunday; was part of a meeting with Pelosi in the Capitol on Tuesday and talked with her about the deal on the House floor on Wednesday.

He said in a statement, “As a businessman, I know that a transition plan is critical for any institution. Leader Pelosi has signaled her commitment to transfer her knowledge and experience to the next generation of leaders so that they may effectively lead the Party into a new era.”

The agreement, to be ratified by the House Democrats on Feb. 15, also proposes term limits on Minority Whip Steny Hoyer, D-Md., who is 79 and Assistant Minority Leader James Clyburn, D-S.C., who is 78.

Pelosi promised to abide by the deal, even if the House Democrats reject it in February. Hoyer and Clyburn have not endorsed the proposal.

The California Democrat said in a statement, “Over the summer, I made it clear that I see myself as a bridge to the next generation of leaders, a recognition of my continuing responsibility to mentor and advance new Members into positions of power and responsibility in the House Democratic Caucus.”

The deal calls for the members holding the top three Democratic leadership spots to be limited to three terms. If they want a fourth term, the threshold for winning it is tougher. Instead of needing a majority, a two-thirds vote from House Democrats would be required.

The agreement is retroactive. The two terms Pelosi, Hoyer and Clyburn served when Democrats controlled the House between 2007 and 2011 would count. That means the three would serve through 2022, at the most, if the deal were approved.

A source on Pelosi’s team said she had enough votes to win the speakership without the term limits agreement, but did do it in the name of unity. By going into the Jan. 3 House votes with more than enough support, Pelosi can easily let the members in tough districts — where Pelosi was an issue — keep their promise to vote against her for speaker.

Democratic House leaders in the pipeline for future top spots include Rep. Cheri Bustos, D-Ill., 57, the new chair of the Democratic Congressional Campaign Committee.