LOUISVILLE, Ky. — Hillary Clinton lost West Virginia Tuesday night to rival Bernie Sanders, continuing her slog through the Democratic primary even as she spent the past week fending off attacks from presumptive GOP nominee Donald Trump.

“Let me be as clear as I can be: We are in this campaign to win the Democratic nomination,” Sanders told a crowd of thousands of supporters in Oregon Tuesday night. He predicted a string of wins in Kentucky, Oregon and the Dakotas over the next couple of weeks.

Clinton is fighting on two fronts. The former secretary of state has a near-lock on the Democratic nomination, but continues to lose states to Sanders, who hammers on her as a creature of Wall Street at his rallies that still draw thousands of supporters. Trump, meanwhile, now clear of any GOP rivals, has spent the past week directing all his considerable fire at her.

Trump’s called her “Crooked Hillary” and resurrected his attack against Bill Clinton’s past sexual relationships with women, painting Hillary as an “enabler” who wanted the women “destroyed.” At a rally in Washington Sunday, Trump said Hillary was playing the “woman card” to get support. “You know what? The women get it better than we do, folks. They get it better than we do. If she didn’t play that card, she has nothing,” he said.

Clinton gave several TV interviews the past week — more than usual for the candidate — and debuted her line of attack against Trump as a “loose cannon” who can’t be trusted with the nation’s security. She also rolled out a sweeping policy proposal in several stops in Kentucky on Tuesday, including a plan to provide federal grants and other assistance so that no family pays more than 10 percent of its income on childcare.

“Boy, do I think this presidential election has about the highest stakes that we’ve seen in a very long time,” she told a fired-up crowd in Louisville Tuesday evening.

She playfully pushed back on Trump’s “woman card” attacks. “I have never gotten a discount when I got to the cashier,” she said. Clinton repeated her defense of Trump’s woman card attack, saying that if caring about women’s health means playing the woman card, then “deal me in!” The crowd shouted the words in unison with the candidate.

See the graphic: Where the Republican Party stands on Trump >>>

Clinton didn’t mention Sanders. The campaign’s director of state and political engagement, Marlon Marshall, sent a fundraising email to supporters about the need to prepare for the general. The email included code visible to readers who received it on their phones. The coded message proclaimed, “Here comes the general.”

But the Clinton campaign has been sucked back into the Democratic primary all the same, spending nearly $200,000 on TV ads in Kentucky’s Democratic primary, which takes place next week. The ad buy is the campaign’s first since April 26, when Clinton swept several Mid-Atlantic states and pivoted toward the general election. But Sanders refused to get on board with that plan. He won Indiana last Tuesday, and has vowed to continue to fight for every last vote in the primary, even threatening to contest the Democratic convention in July.

The campaign celebrated Clinton’s primary ad buy. “If you’re looking for a sign that the Clinton campaign knows this primary is far from finished, here it is,” Sanders campaign manager Jeff Weaver wrote in an email to supporters earlier Tuesday.

Sanders would need to win every remaining state by unprecedented margins to beat Clinton in the delegate race at this point, making his chance of winning the nomination remote. But his continued wins pull Clinton away from the general election, where Trump is focusing all of his energy.

Slideshow: The campaign for Primary Day, May 10 >>>

Trump recently seized on Clinton’s town hall comments in March when she vowed to put coal miners out of business in favor of clean energy jobs. Last week, Clinton spent days on a tour through Appalachia apologizing for those remarks, and they most likely hurt her in West Virginia’s primary.

Still, it’s possible that by staying out of the general election fray, Clinton will appear to be taking the high road to voters, while Trump’s more personal attacks may backfire, particularly among women. She continues to lead him in polls by wide margins in hypothetical head-to-head match ups.

Clinton hinted as much in an interview with reporters Monday. “I’m going to let him run his campaign however he chooses,” she said. “I’m not running against him. He’s doing a fine job of doing that himself. I’m running my campaign.”

Yahoo reporter Hunter Walker contributed to this report.