(Bloomberg) -- Nancy Pelosi’s historic run as speaker will come to an end with the Democrats’ unexpectedly narrow loss of their US House majority, a power flip that comes as a new generation of leaders clamors to take over the party.

Pelosi, 82, was set to announce her plans for the future on Thursday, according to her spokesman, and is expected to deliver remarks on the House floor soon.

She has been the Democratic House leader for almost two decades and is the only woman to be elected speaker, serving in two stretches and under four presidents. Yet despite her prodigious fundraising prowess and tight control of the caucus, Pelosi’s hold on the top spot was challenged even before the midterm elections as centrists and progressives alike agitated for change.

Last week, she was re-elected to her 19th term representing her San Francisco district. On Sunday, Pelosi declined to say whether she would run for caucus leader again in a closed-door party election this month.

“The fact is that any decision to run is about family and also my colleagues. What we want to do is go forward in a very unified way,” she said on CNN’s “State of the Union.” 

Pelosi has said that the vicious attack on her husband, Paul Pelosi, in their home by a hammer-wielding assailant on Oct. 28 would be a factor in her plans. But she has also said she’ll always have influence over House Democrats, whether or not she’s their leader. 

Pelosi still has broad support among those Democrats, and the party’s better-than-expected performance in the midterms, when it was expected to lose as many as 25 seats, has only served to enhance her prestige.

“Everyone is giving her a wide berth,” Representative Rick Larsen of Washington State said Tuesday. “No one works harder than Nancy Pelosi.”

President Joe Biden and Senate Majority Leader Chuck Schumer both have encouraged her to stay. Pelosi, in a statement Wednesday night, praised her party for having “defied expectations” in the elections. 

“House Democrats will continue to play a leading role in supporting President Biden’s agenda -- with strong leverage over a scant Republican majority,” she said.

Still, the loss of the majority is likely to trigger a broader struggle over control and direction of the party in the House. Majority Leader Steny Hoyer, 83, and Majority Whip James Clyburn, 82, may also come under pressure to step aside, though neither has given an indication they’re ready to give up leadership posts. 

In a late September meeting with reporters, Hoyer swatted away questions about Pelosi’s promise in late 2018 to abide by a term-limit deal with some caucus members to step down from leadership by the end of this term. He said, “We’ll see what she does,” adding: “I think she will have to answer for herself. I will answer for myself.”

The Republican takeover “essentially guarantees a leadership transition,” said Joshua Huder, a senior fellow at Georgetown University’s governmental affairs institute. 

New York Representative Hakeem Jeffries, 52, is widely considered the heir apparent to Pelosi. He has been the chairman of the House Democratic Caucus since 2019, and he has also taken on other leadership roles, most notably as one of seven House managers in the first impeachment trial of President Donald Trump.

Other Democrats expected to seek leadership roles are Massachusetts Representative Katherine Clark, 59, who is the No. 4 House Democrat, and Washington State Representative Pramila Jayapal, 57, the chair of the Congressional Progressive Caucus. 

Much of the demand for change has come from the Democrats who got elected in the 2018 midterms and as such were instrumental giving Pelosi a chance to return to the speakership. 

“I think we absolutely need a lot of fresh voices in leadership. It’s been 20 years,” Representative Abigail Spanberger, who was part of that 2018 wave, said at a pre-election campaign event in Fredericksburg, Virginia. “Issues have changed, policies have changes, Congress has changed.” 

Spanberger, who was re-elected last week, refused to support Pelosi as speaker in 2019 and 2021. 

Pelosi has often deflected questions about whether she will keep to the agreement with restive House Democrats to step down from leadership at the end of this congressional term.

“Yes, we need generational change. Of course we do,” Pelosi said last month in an interview on MSNBC. “But in some cases there’s no substitute for experience.”

This is Pelosi’s second loss of the House majority as speaker, a position that puts her second in line to the presidency. She first became speaker in 2007 and was re-elected in 2009, but lost the gavel in 2011 after Republicans, propelled by the conservative Tea Party movement, won the House majority in the 2010 election.

Pelosi, a master legislative tactician, was elected speaker again in January 2019 after she had led Democrats back to the majority in the 2018 mid-term elections under Trump. However to secure the role, she had to acquiesce to a term-limit push from factions within her caucus and commit to not seeking the gavel or top House party post beyond the term that ends in January.

Even if Pelosi is entering her final weeks as the top House Democrat, her place in history will go far beyond the barriers she broke as a mother of five first elected to Congress at age 47, then rising through party ranks and eventually ascending to the speakership.

Her career will also be recalled for the often polarizing political battles she waged under four administrations, helping to shape some of the most consequential legislation in modern American history, and in overseeing the two Trump impeachments.

Among her biggest accomplishments was helping to enact the Affordable Care Act with President Barack Obama. She was also instrumental in passing the Dodd-Frank Act to reform Wall Street after the Great Recession, as well as the economic stimulus package to help banks and others recover from that financial crisis.

More recently, she managed her fractious caucus to pass large parts of Biden’s economic agenda, including last year’s bipartisan infrastructure bill and this summer’s Inflation Reduction Act, which included historic investments in climate programs. She also reasserted her longtime hawkish stance on China with a visit this summer to Taiwan despite outrage from Beijing.

Her challenges have included guiding Congress’s responses to the coronavirus pandemic and the ongoing investigation into the attack on the Capitol in January 2021. 

--With assistance from Mackenzie Hawkins.

©2022 Bloomberg L.P.