President Donald Trump blasted her "socialist agenda." The GOP depicted her as head of an "unhinged mob." Fellow Democrats shielded themselves by disavowing her leadership.
Still, Nancy Pelosi won.
For the second time in a dozen years, a Democratic campaign she oversaw ousted the Republicans who ridiculed her from control of the House. At age 78, the veteran liberal from San Francisco stands to become just the third House leader in the past century to seize the speaker's gavel twice.
"They've been doing that for a long time," Pelosi told me in an interview as she awaited election night returns. "Hundreds of millions of dollars. They do this because they are bankrupt of ideas."
The Republican attacks had some effect. Exit polls showed that 55 percent of voters view Pelosi unfavorably — the same share that disapprove of Trump.
But 24 percent of those unimpressed with Pelosi voted for the Democratic candidate anyway. Only 11 percent of those unhappy with Trump voted Republican.
In part, that's because Pelosi bested Trump in shaping the campaign dialogue. Her personal standing mattered less to voters, but her agenda mattered more.
As expected, GOP candidates dominated among the 22 percent of voters who identified the robust American economy as their top issue. They also dominated among the 23 percent who named immigration, which Trump hammered relentlessly down the campaign homestretch.
But more voters by far — 42 percent — identified Pelosi's signature health-care issue as their top priority. Roughly 8 in 10 of them voted Democratic.
"I feel very proprietary about that," Pelosi said of the Affordable Care Act that she and President Barack Obama shepherded to passage in 2010. "They attached me to that. I'm happy to be attached to it."
By campaign's end, in fact, the same Republicans who tried unsuccessfully to repeal the law paid Pelosi the ultimate compliment. Facing voters nervous about losing Obamacare protections for those with pre-existing health conditions, GOP candidates insisted they support those protections, too.
"They didn't tell the truth," Pelosi said. "That brought the reality home to the American people that they were affected by it."
Different tasks await her now. More than two dozen House Democratic candidates publicly refused to support her for House speaker. In a party increasingly reliant on millennial support, some younger Democrats want a new generation to seize control.
So far, Pelosi told me, "I haven't asked a single member for a vote." Asked if she has any doubts about nailing down sufficient support, she replied simply, "No."
As speaker during Obama's first term, Pelosi wrangled votes with extraordinary effectiveness. In addition to Obamacare, she led Democrats to enact major economic stimulus, the Dodd-Frank financial regulation law and a limit on carbon emissions that ultimately failed in the Senate.
As minority leader, Pelosi has kept Democrats unified enough to leverage major concessions from fractious Republicans on spending priorities. She can draw on experience sharing power with President George W. Bush in 2007-08 for the pending reprise with Trump.
"I'm very well prepared for this fight," Pelosi said.
One center of conflict will be executive branch oversight that the outgoing Republican majority has refused to undertake. Pelosi named "honest government" as a top priority. A Democratic aide subsequently confirmed the House will seek Trump's tax returns.
Pelosi dismissed the possibility of attempting to impeach Trump unless findings from Robert Mueller's Trump-Russia investigation prove grave enough to draw Republican support.
"I don't think there's any impeachment unless it's bipartisan," she said. "Our priority is to get results for the American people."
A major infrastructure spending bill offers one possibility for compromise, given candidate Trump's embrace of the idea. But trillion-dollar budget deficits following the GOP tax cut make that a challenge.
Action to lower prescription drug costs offers another. But Democrats want to go much further than Trump in using the government's purchasing power to negotiate lower prices, and a Republican-controlled Senate is unlikely to approve.
Democrats lean toward Trump's protectionism on trade, if not how he has pursued it. But the NAFTA replacement Trump has negotiated with Canada and Mexico only marginally changes the original, and Pelosi was noncommittal on ratification.
"That's a work in progress," she said.
For now, Pelosi can savor a victory that extends her 2006 breakthrough in becoming the nation's first female speaker. Women have powered Democratic resistance to Trump from the outset of his presidency and powered House election gains for Democrats, too.
For the first time in American history, more than 100 women will serve in the new Congress. Pelosi cast her determination to extend her career as a message to them.
"Women come up to me all the time to say 'thank you for fighting,'" she said. "I don't want women to think if you get attacked, you run away."