House Speaker Nancy Pelosi of Calif., strikes the gavel after announcing the passage of article II of impeachment against President Donald Trump December 18, 2019 on Capitol Hill in Washington. [AP Photo]

There are two searing scenes of Nancy Pelosi confronting the violent extremism that spilled into the open late in her storied political career. In one, she's uncharacteristically shaken in a TV interview as she recounts the brutal attack on her husband.

On the other, the House speaker rips open a package of beef jerky with her teeth during the Jan. 6, 2021, Capitol insurrection, while on the phone with Mike Pence, firmly instructing the Republican vice president how to stay safe from the mob that came for them both. "Don't let anybody know where you are," she said.

That Pelosi, composed and in command at a time of chaos, tart but parochial-school proper at every turn, is the one whom lawmakers have obeyed, tangled with, respected and feared for two decades.

She is the most powerful woman in American politics and one of the nation's most consequential legislative leaders - through times of war, financial turmoil, a pandemic and an assault on democracy.

Now, at 82, in the face of political loss and personal trauma, she decided her era was ending.

Pelosi stood in the well of a rapt House on Thursday and announced she would not seek a Democratic leadership position in the Congress that convenes in January, when Republicans take control of the chamber. Pelosi, who will remain a member of the House, took her time revealing the news, looking back over an improbable career and recalling her first visit to the Capitol at age 6 with her congressman father.

"Never would I have thought that I would go from homemaker to House speaker," she allowed. On her future, she told reporters: "I like to dance, I like to sing. There's a life out there, right?"

Polarizing and combative, Pelosi nevertheless forged compromises with Republicans on historic legislation.

Across the policy spectrum, whether you liked the results or not, she delivered votes that touched ordinary lives in many ways. Among them: how millions get health care, the state of the roads, the lightened burden of student debt, the minimum wage, progress on climate change that took over a decade to bear fruit.

Even former Republican Speaker Newt Gingrich, a self-described "partisan conservative who thinks that most of her positions are insane," said Pelosi had a "remarkable" run. This, from a fellow "troublemaker with a gavel," as she called herself. He flamed out; she didn't.

"Totally dominant," Gingrich said of her in an interview. "She's clearly one of the strongest speakers in history. She has shown enormous perseverance and discipline."

Few survive

Those qualities are essential if you don't want to be run out of town, as was a succession of modern Republican speakers, back to Gingrich. It's one thing to herd sheep. It's another thing altogether to herd Democrats and all their messy factions.

Pelosi dealt with conservative Blue Dog Democrats, the liberal women of the Squad, the Out of Iraq Caucus - not to mention old-guard legislators who treated their committees like fiefdoms.

Many of the above, at one point or another, earned her look of icy disapproval, well practiced and not always reserved just for the other side.

"Politics is tough," she said in 2015, "but intraparty? Oh, brother."

Squad member Ilhan Omar of Minnesota, not always Pelosi's biggest fan, spoke Thursday of how Pelosi had "served as a beacon of hope" to her and her family when they migrated from Somalia.

Omar, at times the subject of "send her back" chants during Donald Trump's rallies, recalled that Pelosi had invited her to join her on a 2019 trip to Africa "to represent how far we have come as a country."

Princeton political scientist Frances Lee said there's no doubt Pelosi was a "truly great legislative leader, among a handful truly in command. She's really had her party in the House of Representatives in hand. The difficulty of managing them should not be underrated. It didn't always look pretty but she held the party together."

Pelosi prevailed - for nearly 20 years as House Democratic leader including nearly eight as speaker in two separate stints - with hard-nosed sentiments like these:

"Whoever votes against the speaker will pay a price." - to Democrats who resisted her push for a select committee on climate change early in her speakership.

"Nobody's walking out of here saying anything, if they want to keep an intact neck." - to negotiators trying to work out a 2007 House-Senate compromise to restrain pork, according to the notes of John A. Lawrence, her then-chief of staff and author of a new insider book on her speakership, "Arc of Power."

Sometimes, she could snap her lawmakers into line without a word.

A flick of her hand was all it took to silence Democrats who cheered when the House first passed articles of impeachment against Trump. It was an occasion for sobriety and Pelosi was a stickler for institutional decorum. But not always.

She ripped up her copy of Trump's 2020 State of the Union speech, on the dais behind him, on camera. The theatrical protest at one of American democracy's prime rituals raised questions about whether Pelosi, in that moment, had become what she despised in Trump.

Afterward, she said she had extended her "hand of friendship" to him when he arrived but he did not take it. "He looked a little sedated," she added. As she read quickly through her copy of the speech while Trump delivered it, she stewed over the lines and decided to take action.

"He has shredded the truth in his speech, shredded the Constitution in his conduct - I shredded the address," she said crisply. "Thank you all very much."

The villainisation

In 2007, Republican President George W. Bush opened his speech as the "first president to begin his State of the Union with these words: Madam Speaker." He grinned, she beamed, an ovation followed.

Although she maintained a genial relationship with the Bush family - especially the elder George Bush - Republican campaigns seized on her as the perfect foil early on and never let go. She was pilloried as "Darth Nancy" in the 2006 campaign and the villainisation got much uglier, complete with gun imagery, as the years passed and politics became more toxic.

"She was, she is, the personification of the San Francisco liberal," Lawrence said in an interview. "It was made to order for them."

But "with her there was a viciousness. The fact that she fit that bill so perfectly - a smart, attractive, effective woman ... they knew they could caricature and stigmatize things about her, her appearance and style, in a way that was a very effective dog whistle of misogyny."

Republicans often did it simply to raise money, and it worked. Then they used her in ads to attack Democratic congressional candidates. Some of those worked, too,

At least publicly, she would never attribute the attacks to the fact she's a woman, Lawrence said. "She would say, 'They did it because I'm effective.'" Then "pretend to flick dust" off her immaculate jacket.

"Darth Nancy" was a quaint, faraway insult by the time the pro-Trump mob came looking for her that Jan. 6. Their sign at the Capitol said "Pelosi is Satan."

Rifling through her desk in the abandoned speaker's office, they found a pair of boxing gloves.

Pink ones.

The do-lots Congress

Over the years, Pelosi honed the art of aiming high, then disappointing one faction of her party or another without losing her core of support. Rare is the major achievement that was as far left as the party's left-wing wanted it to be.

But many are the major achievements. She settled for an "Obamacare" bill that did not give everyone the option of government health insurance, but did, over time, fundamentally expand access to health care.

As financial institutions and large segments of the economy sank into the Great Recession, with the 2008 election looming, she settled for a Bush-era stimulus package that essentially bailed out Wall Street - when liberal Occupy Wall Street activists had very different ideas.

She delivered Democratic votes to help even some Trump initiatives get over the line, like early COVID-19 pandemic relief, before swinging behind President Joe Biden on some of the most far-reaching legislation since Lyndon Johnson's Great Society push in the 1960s.

And Bono, who worked with Pelosi over the years on combating AIDS, said in a statement to the AP after a performance Thursday night in Scotland: "When the story of the end of AIDS is written, Nancy Pelosi's name will stand out in boldface."

"I am honored to have learned so much from her grit and grace, and to call her a friend," he added.

For all the accolades, Pelosi crushed a multitude of toes along the way.

"Her instincts are to find a path and if you happen to be standing in the hole, she's going to treat you like a running back," said political scientist Cal Jillson at Southern Methodist University. "If she can go through you, fine. If not, you're headed to the medicine tent."

Some of the toes squashed by Pelosi belong to Jane Harman, a fellow Californian who long ran in the same circles as the speaker. She returned to Congress in 2001 after a two-year gap, armed with a written promise from Democratic leaders that she could reclaim her seniority and become chair of the sought-after Intelligence Committee if the party took control of the chamber.

When Democrats did so in 2007 and Pelosi became speaker, she bumped Harman from the committee, citing term limits that had not always been evenly applied. Harman believes the real reason was that Pelosi was under pressure from liberals not to give the job to someone who had supported the war in Iraq.

"I think, looking back, that she was under pressure from the left not to promote somebody who had voted for the war."

Still, Harman, who left Congress in 2011 to lead the Wilson Center think tank, allows that Pelosi has "a very good political radar and she has kept the caucus together."

When Pelosi entered Congress in 1987, men chaired all the House committees and no women had led one since the 1970s, by the reckoning of House historians. In the 1970s, the most popular committee chair appointment for women in the House was to lead the Select Committee on the House Beauty Shop before that panel vanished at the end of that decade.

Under Pelosi, women took over more panels and gained weightier assignments while the speaker worked to advance authority for minorities in her ranks as well as their numbers.

"She led in a way that did set the stage for other women and open the doors for their potential," said Debbie Walsh, director of the Center for American Woman and Politics, at Rutgers University. "Things have moved. And she is a big part of that."

The Pelosi ceiling

Because of the speaker's longevity, however, many other up-and-comers in the party besides Harman have discovered they could only rise so far before hitting the Pelosi ceiling. The top job simply hadn't been available.

Pelosi faced none of the questions about sharpness or stamina that dog Biden, 80 on Sunday. She still races around Congress, in high heels, at a pace that people half her age can find hard to match.

But even before the elections, concern had grown in the ranks about the crowd of older Democratic leaders from the same era still in charge. "No brewing rebellion," said Lee at Princeton, but "a sense that maybe it is time."

Leon Panetta, former CIA and Defense chief and chief of staff to President Bill Clinton, had nothing but praise for Pelosi's leadership and skill but said she "probably could have spent more time building a stronger bench in terms of leadership in the House and trying to make sure that others could follow in her path. That becomes a question mark now as to just exactly who's going to be able to replace her."

Panetta met her in the 1980s when he was a congressman from California and she was getting started as a Democratic fund-raiser extraordinaire after her family had moved to that state. She had already learned lessons about transactional politics as the politically engaged daughter of Thomas J. D'Alesandro Jr., a three-term Baltimore mayor and five-term member of Congress from Maryland.

Her prowess in persuading people to open their wallets on behalf of Democratic candidates was one of the keys to her success. Harman calls those dollars crucial to the "big tent" that Pelosi erected for her caucus and to her ability to hold sway over it - "a $1.25 billion tent."

Michigan Rep. Fred Upton, a Republican who was in the same freshman class with Pelosi and is retiring from Congress, said of her: "This is why the Democrats had more money than God. She was magic, and I don't think she lost a vote."

Gingrich tacks on other elements of her power: "Her fundraising, her ability to inspire intense loyalty, her willingness to punish people who don't do what she wants."

"As a professional, you have to have great respect for her ability to acquire and wield power and her ability to build what was an effective machine," he said.

Senate Republican leader Mitch McConnell said in a statement that despite their many disagreements, "I have seen firsthand the depth and intensity of her commitment to public service. There is no question that the impact of Speaker Pelosi's consequential and path-breaking career will long endure."

In Pelosi's reign, nothing was left to chance - even her clothing was curated to send a message: She paired a black dress worn during the Trump impeachments with a gold pin depicting the mace of the House, a symbol of her power. When she swooshed out the doors of the White House after one particularly pointed encounter with Trump, her sunglasses and burnt-orange winter coat were quickly the stuff of social media memes.

On Thursday, for the big reveal of her plans, Pelosi wore suffragette white and her mace brooch.

Pelosi told reporters the attack on her husband, Paul, also 82, last month made her inclined to stay in leadership, so as not to give extremists the satisfaction of seeing her leave. She might have hung in, she indicated, if Democrats had won a majority.

The attacker, who police say had come looking for the speaker, fractured her husband's skull with a hammer. Pelosi said she is working through "survivor's guilt."

Could there be a third-generation Pelosi headed to Congress after the speaker and her father? It's long been thought that Nancy's daughter, Christine, would be at the front of the line for the congressional seat whenever Pelosi decided to retire.

In her time, Pelosi went beyond domestic politics to stake a claim to congressional influence in foreign policy on behalf of the House as an institution, pointing her gavel outward in a way speakers had rarely done.

Well beyond her annual Mother's Day visits to women in combat overseas, Pelosi traveled to foreign leaders with a mission to project U.S. stability, particularly during the unpredictable Trump years but also before and after.

She traveled secretly to Kiev early in the Russia-Ukraine war and caused some grief in the Biden administration with her diplomatically dicey visit to Taiwan this year.

Pelosi had a history of standing up to China. On her first foreign trip after being elected to Congress in 1987, she joined other U.S. lawmakers in 1991 in unfurling a banner at Tiananmen Square after Chinese authorities crushed pro-democracy demonstrations there in 1989. Her recent Taiwan visit was another slap at Beijing.

For all her clout in the government, Pelosi was an unpopular figure in the country overall. In a Pew Research Center poll conducted in late June and early July, only about a third of respondents had a favorable opinion of Pelosi, while 6 in 10 were unfavorable toward her.

Most Democrats and Democratic leaners - about 6 in 10 - were thumbs up about her, though she lagged Biden and Vice President Kamala Harris, both rated favorably by three-quarters of Democrats. About 9 in 10 Republicans viewed her unfavorably.

Through it all, she went at practically everything as if it had a best-before date. After all, she would say, "Power is perishable." Washington is "the perishable city."