House Minority Leader Nancy Pelosi D-Calif.) faces a test in 2018 that will seal or undermine her legacy: winning back the House. (Carolyn Van Houten/The Washington Post)

Nancy Pelosi wanted everyone to know that she had been here before and knew what to do.

“Let me just give you some hope,” the House minority leader told campaign donors on Oct. 17 at a private gathering on the patio of the Las Vegas Four Seasons Hotel. “Any time a president in office is below 50 percent [approval] in recent history, his party has lost the Congress in the next election.”

Her sample size was a bit small for comfort — in the past half a century, only the three most recent presidents have given up the House. But this was a pep talk, not an academic symposium.

Pelosi, a San Francisco Democrat who has raised more than $633 million for her party over the past 15 years, was on a seven-city, eight-day tour to show that the 2018 midterm campaign was in full swing. The Democratic effort to retake the House and return from the wilderness would probably rise or fall on the performance of one of the most polarizing figures in modern American politics.

“We have a plan and a vision to unify,” she told the donors, according to attendees.

After three decades in Congress, Pelosi, 77, makes an unlikely general to lead the troops into another change election. Her party, deemed elite and out of touch in 2016, is struggling to win back Midwestern working-class voters, and anger at Washington’s entrenched leaders is pretty much the only thing that unites the country.

But rather than shrink from the spotlight, Pelosi is once again in control — her party’s top fundraiser, senior midterm-election strategist and top legislative negotiator, in partnership with Senate Minority Leader Charles E. Schumer (D-N.Y.).

She has for months led a rolling battle with President Trump's agenda, setting a disciplined, pugilistic tone for her caucus and casting herself as the official face of the resistance. With substantial help from the opposition, she has been winning more than not, at least as measured by a growing number of competitive seats, her ability to outmaneuver Republican leaders on Capitol Hill and Trump's low approval ratings.

“There are a lot of ways to skin a cat,” she likes to joke about the president. “And he is skinning himself.”

That doesn’t mean that anything is ordained. “It’s not a slam dunk,” she told the donors. Given all the things that can still go wrong, she was almost certainly understating the risk.

A second shot

The last time Pelosi led Democrats in an effort to take back the House, she was a new face on the scene, promising to “drain the swamp” a decade before Trump adopted the phrase. She became the first female speaker and the most powerful woman in American history, only to lose the gavel four years later — after passing the Affordable Care Act, the 2009 stimulus and new financial regulations.

These days, undocumented immigrant activists shout her down from the left when she visits the Bay Area. Some of the younger House Democrats have begun to call for a generational change at the top. And Republicans delight in the possibility of turning Midwestern races into referendums on San Francisco values.

Over the summer, the GOP won a special House election in Georgia by tarring the local candidate with the Pelosi brand. One ad featured the Golden Gate Bridge, cable cars and a pig-tailed hippie flashing a two-fingered peace sign. Democratic pollsters later found in focus groups that attacking Washington liberals proved effective in the Republican-leaning district.

"I certainly hope the Democrats do not force Nancy P out," President Trump taunted weeks later on Twitter. "That would be very bad for the Republican Party."

Pelosi denies that any of this affects her or her caucus, arguing that 70 seats will be more competitive next year than the one Democrats lost in Georgia. Instead, she defiantly flashes a gay-pride rainbow flag band on the Apple Watch on her left wrist, refusing to disguise her liberal credentials.

“Self-promotion is a terrible thing, but evidently someone has to do it,” she explained a few days earlier, sitting in her Capitol office for one of several interviews with The Washington Post over the past two weeks. “The minute you do better, they will come after you, and that’s why they come after me.”

No one doubts that Pelosi can put points on the board. Through the end of September this year, she held 165 fundraising events in 35 cities, raising $38.9 million for House Democrats — helping top the committee fundraising haul of Republicans, according to her aides.

From left, Vice President Pence and President Trump meet Sept. 6 with Senate Majority Leader Mitch McConnell R-Ky.), Senate Minority Leader Charles E. Schumer D-N.Y.) and Pelosi. Schumer and Pelosi secured a three-month budget extension in the talks, giving Democrats a leg up in a December faceoff. (Bill O'Leary/The Washington Post)

She also has made herself a constant national media presence, including with four hour-long CNN prime-time specials this year alone — more airtime than many of the network's paid contributors. "If you know the name of any legislator who knows how (and wants to) do that job, please give it to me so my children can have their grandmother back!" said her youngest daughter, Alexandra Pelosi, in an email.

Behind the scenes, Pelosi has been working with Republicans to undermine the Trump agenda. In recent months, she has strategized with Republican governors over preserving key parts of the ACA. She described Nevada Gov. Brian Sandoval as a “resource on persuading others” to resist Medicaid cuts, and aides said she also talked with Ohio Gov. John Kasich and Alaska Gov. Bill Walker, an independent. A spokesman for Walker confirmed the conversations; the offices of Sandoval and Kasich did not reply to a request for comment.

She also has led her caucus to negotiating victories in Washington. The budget agreement this past spring failed to fund most Republican priorities, including a new border wall, while providing billions for medical research, disaster funding and college grants. "Even though they had the signature and two majorities, we ate their lunch," Pelosi boasted. "That's what we do."

The process repeated itself last month, when she joined Schumer in winning Trump's support for a three-month budget extension, set to create a December showdown over the 2018 budget. Senate Majority Leader Mitch McConnell (R-Ky.) later argued that the deal was not as bad as it seemed. "He was trying to pin a rose on it, poor baby," Pelosi said. "We now have more leverage."

Next she is leading the campaign to turn the American public against Republican tax legislation, which she calls “our Armageddon.”

“Nancy is key to maintaining our unity,” said Rep. Nita M. Lowey (N.Y.), the ranking Democrat on the House Appropriations Committee. “She knows the process, she knows the policy, and she knows the politics better than anyone.”

Staying on message

The big task before Pelosi, the one that will ultimately seal or undermine her legacy, is the Democratic preparation for 2018. Her plan is much the same as in 2006: Keep her members focused on an economic message — “better jobs, better wages, better future” — raise a ton of money, recruit candidates and endlessly repeat her revolving databank of alliterative catchphrase trifectas.

“Money, message and mobilization,” she says to describe Democratic priorities. “Cronyism, corruption and incompetence” is another, which she invokes to describe the party of Trump, echoing a phrase she deployed against President George W. Bush.

"Democrats have a growing number of takeover scenarios, but we won't know until later next year which races develop into serious opportunities," explained Nathan Gonzales, who runs the political handicapping operation Inside Elections. The takeover potential looks far stronger for Democrats in the House than in the Senate.

But Pelosi is convinced the effort will work only if Democrats stay disciplined. Her friend and Democratic donor Tom Steyer recently started airing television ads to demand Trump's impeachment, creating a clear risk to Pelosi's economic message.

Her response has been a study in nuance. “I think the presentation that Tom Steyer made was one that no one could disagree with in terms of justification,” she said before explaining that outside advocates have a different role from those in government. She wants to keep the focus on jobs. “Everything is an opportunity cost of time,” she added.

Pelosi has also opened the door to bringing more moderate politicians into the party. Her staff says she has no concerns if some Democratic candidates in tough districts, including Paul Davis in Kansas, promise on the campaign trail to turn her out of office.

That doesn’t mean she does not share her colleagues’ disdain for Trump. She jokes that her nicknames for the president are “Rock Bottom” and “Difficult Circumstances.” But she also holds back. “I am respectful of the people that voted for him,” she said. “They are way down the road with me already because they vote.”

Underlying her entire approach is a fierceness, born not from the frontier liberalism of San Francisco but from the calculating, ethnic, big-city politics of Baltimore. There, her congressman-turned-mayor father regularly displayed the cold mathematics of coalition building in their living room, which also served as his headquarters.

Thomas D’Alesandro Jr.’s photograph hangs on his daughter’s Capitol office wall. It’s a picture of him speaking to first lady Eleanor Roosevelt at a 1940 hearing, given to her by former president Barack Obama.

Pelosi still embraces the formality of those days, preferring restaurants with tablecloths, greeting visitors in her office with poured glasses of ice water and often insisting on pleasantries before getting down to business. “Enjoyment is not it,” said former congressman George Miller (D-Calif.), a longtime friend. “What she enjoys is opportunity. She came from a family where politics was about getting things done for people.”

She also maintains an unflinching focus on her historic achievement. One of the reasons Pelosi did not follow through with her plan to step aside after the last election, she said, was the realization that without Hillary Clinton in the White House, she remained the only senior woman in government.

“I am a master legislator. I just love it,” she said of her inherited appetites. “I consider myself a weaver, like I have a loom. And I bring all these different threads together.”

While Pelosi said she has never experienced sexual harassment in the workplace, she also believes that the unacceptable level of sexism in the culture has changed little since the 1980s. “No, it’s about the same: nick, nick, nick, nick,” she said, pointing with her hands to demonstrate how women’s power is undercut by the men. This is one of the reasons, she said, that she is so unabashed about pointing out her own abilities.

When former White House strategist David Axelrod, a longtime champion, recently asked her in an interview for his podcast whether she would serve out her term, she declined to answer and snapped back: “How many men have you asked that question to?” It’s really a girl question.”

After the interview, Axelrod spoke of Pelosi with unerring admiration. “She is tough as nails,” he said.

Finding leverage

About a week after the Vegas fundraiser, Pelosi traveled to her alma mater, Trinity Washington University, a Catholic women’s school in the District, where more than 10 percent of the student population are “Dreamers” — undocumented immigrants brought to the country as children.

Pelosi meets Dreamers at Trinity Washington University in the District on Tuesday. (Carolyn Van Houten/The Washington Post)

She told the students Democrats would not leave for the winter break without a legislative fix to give them legal status. It was an implicit threat: If Republicans wanted Democratic votes to prevent a government shutdown, they would need to deal. But she denies any effort by Democrats to shut down anything. “They have the votes, and they have the White House,” she said of the Republicans. “They have the power to keep government open.”

That is a crafty bit of messaging, an attempt to take responsibility off Democrats, even though it has been clear for months that Republicans cannot hold their caucus together. “Their disunity gives us leverage,” she explained. “They need our vote. We need our say.”

This is the plight of the current Republican leadership. Did she ever feel sympathy for speakers John A. Boehner or Paul D. Ryan as they struggled in their jobs?

“No,” she said, without flinching. “Pity.”