House Minority Leader Nancy Pelosi, a Democrat from California, speaks at a House Democratic election night event in Washington, D.C., U.S., on Tuesday, Nov. 6, 2018.

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."