House Minority Leader Nancy Pelosi is in advanced negotiations with critics inside her party about an agreement that could clear the way for her to be elected speaker next month.

Despite presiding over a 40-seat midterm pickup last month, Pelosi (D-Calif.) has been dogged by internal opposition from a handful of Democratic lawmakers and incoming freshmen who have long agitated for new party leadership.

Pelosi, 78, has served 16 years as the highest-ranking House Democrat, including four years as speaker, from 2007 to 2011. But she has given no sign that she is willing to step aside and has spent the past month calling on an extensive political network inside and outside the Capitol to help her regain the gavel.

That has put intense pressure on the holdouts, who have spent the past two weeks in on-and-off talks about how to pave the way for an eventual leadership transition while allowing Pelosi to reclaim the speaker’s gavel in January.

The talks were confirmed by three Democrats familiar with the negotiations but not authorized to discuss them ahead of a final agreement. Two of the Democrats said that while progress has been made, no deal is imminent.

“A few steps forward, a few steps back,” one person said in describing the talks.

Outgoing Speaker Paul D. Ryan (R-Wis.) and House Minority Leader Nancy Pelosi (D-Calif.) walk away after paying their respects to former president George H.W. Bush in the Capitol Rotunda on Dec. 3. (Jabin Botsford/The Washington Post)

Pelosi declined to comment. Politico first reported on the talks Monday.

The negotiations surround the prospect of term limits for both committee chairmen — something Pelosi and other Democrats have debated — as well as term limits for party leaders themselves, the Democrats said. Rep. Ed Perlmutter (D-Colo.), a leader of the critics’ group, has been shuttling proposals between Pelosi and the larger group.

Perlmutter declined to comment Monday after lingering more than an hour on the House floor speaking to colleagues after evening votes. Another leading Pelosi critic, Rep. Seth Moulton (D-Mass.), also declined to comment but said that “negotiations are ongoing.”

Those familiar with the talks said a deal would be unlikely to win support of all the approximately two dozen Democrats who have stated opposition to Pelosi. But the expectation, they said, is that enough could be persuaded to allow Pelosi to be elected speaker in a Jan. 3 floor vote while allowing more than a dozen freshmen who spoke out against Pelosi during their campaigns to vote against her.

House Democrats have generally operated under a seniority system when choosing their committee chairmen, and they have not placed term limits on them or on the top party leaders. Republicans cap their committee chairmen at three terms; the Democratic talks are focused on a similar limit, the people familiar with the proposal said.

One complication is that Pelosi cannot dictate a term-limits policy; instead, it must be voted on by the entire Democratic caucus, which is expected to count 235 lawmakers next year. Pelosi abandoned an attempt to explore term limits for committee chairmen in 2015 after it became clear that pushing the policy through would badly split Democrats along racial and generational lines.

Veteran members of the Congressional Black Caucus were especially opposed, crediting the traditional seniority system with allowing minority lawmakers to amass power that they otherwise might never be granted.

“I think it would be foolish to take this up now, when we are in the majority and we have so much work to do,” said Rep. Karen Bass (D-Calif.), who previously led a review of the issue at Pelosi’s behest and will chair the Congressional Black Caucus next year. “We don’t need to take up an issue that’s going to cause us to have conflict between each other.”

But, according to two of the people familiar with the discussions, the infusion of new blood after this year’s midterm elections could change the politics surrounding term limits. Fifty-nine new Democrats are set to be sworn in next month, and 46 of them signed a letter calling on Pelosi and other senior leaders to give freshmen a greater say in how Democrats run the House.

Already the first woman to serve as speaker, Pelosi would cement her place in history by joining a small group of lawmakers who regained the speakership after losing it. She would be the first speaker to do so since Texas Democrat Sam Rayburn took the gavel back in 1955. No other two-time speaker has taken the gavel back after more than four years out of power.

Paul Kane contributed to this report.