WASHINGTON ― After quashing a small revolt in her own caucus around Thanksgiving, Nancy Pelosi reclaimed the House speakership Thursday, becoming the first politician in 58 years to take back the gavel.

Pelosi was elected 220-192, with 12 Democrats voting for someone other than the California Democrat and three voting simply “present.”

In remarks just after her election, Pelosi said she was particularly proud to be speaker of the House for the 116th Congress, which marks the 100th year of women having the right to vote, “and that we all have the ability and the privilege to serve with over 100 women members of Congress, the largest number in history.”

Pelosi’s path back to House speaker wasn’t easy. Part of the reason Republicans were able to win back the House majority in 2010 was through a “Fire Pelosi” campaign that made her toxic in some Republican-leaning districts, and Republicans have run on a similar playbook for every election since, including in 2018.

A number of freshman Democrats made promises during the campaign to not support Pelosi if they were elected to Congress, and 10 stood by that vow, voting either “present” or for someone else.

But Pelosi was able to quell a revolt from about a dozen and a half Democrats who were already in Congress. She was able to frame the opposition as misogynist. (Her supporters started the hashtag #FiveWhiteGuys to describe the opposition, even though it wasn’t only white men opposing her and there were more than five.)

She picked off individual members through small promises. (She got the vote of Rep. Marcia Fudge of Ohio by promising to bring back a subcommittee on elections and make her the chairwoman, and she got Rep. Brian Higgins of New York simply by publishing a statement supporting his Medicare buy-in idea.)

And she swung a large chunk of detractors through a deal where she stated her support of term limits for leadership roles and committee chairmen. (The deal set up Pelosi to not only serve this term as speaker but to serve next term as speaker if Democrats hold onto the House.)

It was a classic demonstration of her skill as a legislator. She outworked her opponents. She wore them down, made it uncomfortable to oppose her, and then offered a carrot for their support. And by giving the smallest concession, Pelosi actually solidified her future position. If she serves the next two terms as the No. 1 Democrat in the House, she will have spent 20 years in that position and practically assured through rule changes that no one else could ever do the same.

The House elected Nancy Pelosi as speaker on Thursday. (Photo: ASSOCIATED PRESS)

Pelosi takes the speakership from Republican Paul Ryan, who exited the building entirely in deciding not to run for re-election, during a partial government shutdown. The fitting end to Ryan’s speakership is a political gift to Pelosi, as Democrats are able to unify around her opposition to President Donald Trump and his border wall. The first order of business for Democrats is to pass legislation reopening those closed agencies.

Pelosi has already shown her mettle with Trump during this shutdown. She has been resolute that Democrats won’t approve any money for Trump’s border wall, and she’s positioned Democrats to hammer the president and Senate Republicans for their refusal to take up a bill that passed the Senate unanimously weeks before.

During an Oval Office meeting with Trump and Senate Minority Leader Chuck Schumer (D-N.Y.), she and Schumer were able to goad Trump into taking the blame for a shutdown ― a sound bite that continues to haunt Trump as the shutdown stretches into its second week.

As House Democrats address legislation to end the shutdown, they are also set to take up unifying anti-corruption legislation before facing any of the real fault lines in their caucus. Democrats don’t plan to immediately demand Trump’s tax returns, as they could in the Ways and Means Committee. They don’t have any plans to impeach the president, though some members plan to offer articles of impeachment on Day One. And they won’t be taking up contentious health care legislation any time soon. Pelosi was able to head off a small revolt on the rules package. Some progressive members didn’t want “pay as you go” rules enacted in Congress, for hope of passing a Medicare-for-all bill, but the rules package is expected to easily be adopted later Thursday.

Pelosi, the only woman to ever serve as speaker, takes the gavel after serving eight years as minority leader, with four years as speaker before that and another four years ― from 2003 to 2007 ― as the minority leader previously. She’s been in Congress since 1987.

This story has been updated with more details from the vote and after the vote.

Related Coverage

Nancy Pelosi Wins Democratic Speaker Nomination

Nancy Pelosi Backs House Leadership Limits, All But Securing Bid For Speaker

Nancy Pelosi Says Ability To Indict A Sitting President Is 'Open Discussion'

HuffPost’s “Her Stories” newsletter brings you even more reporting from around the world on the important issues affecting women. Sign up for it here.

Love HuffPost? Become a founding member of HuffPost Plus today.

This article originally appeared on HuffPost.