Pelosi officially has the votes to be the next speaker — if she steps down in 2022

Pelosi just announced a deal with her opponents.

Nancy Pelosi just announced her support for term limits for members of Democratic leadership — including herself, saying she will step down by 2022 even if House Democrats don’t vote for term limits. It’s a move that likely ensures that she will become the next speaker of the House even as it sets an end date for her career as the Democratic leader.

Pelosi announced the deal Wednesday night in a statement. It would set a three-term limit for members of senior Democratic leadership — House speaker, House majority leader, and House majority whip — plus one more term if they got a two-thirds vote to stay on. The two terms from 2007 to 2011 would count toward the limits.

Pelosi added that even if House Democrats don’t agree on the rule — which is supposed to be brought forward by February 15 — she plans to step down by 2022 regardless: “I am comfortable with the proposal and it is my intention to abide by it whether it passes or not,” she said.

One of Pelosi’s top lieutenants, incoming House Majority Leader Steny Hoyer (D-MD), has flatly stated that he is opposed to term limits, which could spell trouble for the leadership going forward.

But in the short term, the move ensures that Pelosi will continue to lead Democrats as the next Congress begins with them in the majority. Pelosi and her top two lieutenants have been in power for more than a decade; a number of younger members had been agitating for change and a fresh face to lead the party for years.

As of earlier this week, Pelosi did not have the votes to clinch the speakership, but the term limits deal she struck mollified the concerns many of these younger members had that a transition of power wouldn’t take place.

Several Democratic members who vowed not to support her for this reason changed their stance immediately after the news.

Minutes after Pelosi’s statement went out, a group of seven House Democrats — Reps. Ed Perlmutter (CO), Bill Foster (IL), Linda Sanchez (CA), Seth Moulton (MA), Tim Ryan (OH), Filemon Vela (TX), and Representative-elect Gil Cisneros (CA) — who had said they would vote no against Pelosi for speaker released a statement saying they would back her under the new agreement on term limits.

“We wish to thank Nancy Pelosi for her willingness to work with us to reach this agreement,” the group said in a joint statement. “We are proud that our agreement will make lasting institutional change that will strengthen our caucus and will help develop the next generation of Democratic leaders.”

With these seven members committing to vote for Pelosi during the January 3 floor vote, she almost certainly now has the votes to become speaker.