At a rally in Salem, Ore. May 10, Democratic presidential candidate Bernie Sanders touted his win in the West Virginia primary, reminding supporters that his rival, Hillary Clinton, won there in 2008. Clinton, meanwhile, looked to woo voters in Louisville ahead of Kentucky's May 17 election. (Sarah Parnass/The Washington Post)

Sen. Bernie Sanders of Vermont easily won the Democratic primary in West Virginia on Tuesday, the first of a string of potentially strong showings this month that may drag out, but not block, front-runner Hillary Clinton’s march toward the Democratic nomination.

Additionally, Donald Trump won Republican primaries in West Virginia and Nebraska — virtually foregone conclusions given that he was the only Republican remaining in the race.

“It is a great honor to have won both West Virginia and Nebraska, especially by such massive margins,” Trump said in a statement Tuesday night. “My time spent in both states was a wonderful and enlightening experience for me.”

Heading into Tuesday, Clinton held a formidable lead in delegates, and because delegates will be awarded proportionally, Sanders’s West Virginia victory was not expected to make much of a dent in that lead. However, his enduring popularity, large rallies and insistence on staying in the race until the Democratic convention in July have highlighted some of Clinton’s weaknesses and prevented her from fully turning her attention to a general-election contest against Trump.

“West Virginia is a working-class state, and like many other states in this country, including Oregon, working people are hurting,” Sanders said at a rally in Salem, Ore., Tuesday night. “And what the people of West Virginia said tonight, and I believe the people of Oregon will say next week, is that we need an economy that works for all of us, not just the 1 percent.”

Sanders’s advantage over Clinton in West Virginia was clear in preliminary exit polling. According to data published by CNN, roughly 1 in 3 Democratic voters identified as an independent, a group that Sanders won by nearly 40 points. Just over 1 in 4 wanted the next president to continue President Obama’s policies, less than half the share who said this across previous primaries this year. Clinton has promised repeatedly to continue to build on many of Obama’s policies and has consistently performed best among voters who support his agenda.

Sanders also benefited from support among Democratic primary voters who said they would favor Trump over Clinton or Sanders in a general election. Roughly 1 in 3 primary voters said they would back Trump in the general election over Clinton, and Sanders won two-thirds of their votes.

Clinton was weighed down by her own troubles. Three in 10 Democratic primary voters said they or a family member were employed in the coal industry, and Sanders won those voters by more than 20 percentage points. Ahead of the primary, Clinton was forced to reckon with comments she made earlier in the campaign about putting the coal industry “out of business.”

Sanders used the West Virginia victory as a rationale to stay in the race “until the last vote is cast.” Less than 15 minutes after the polls closed, Sanders sent out an email to supporters declaring victory and asking for money to help him in the next two contests in Kentucky and Oregon.

Recent polls show Sanders likely to perform well in a string of primaries this month in Oregon, Kentucky and Washington — states with smaller minority populations where Clinton may face similar challenges as in the West Virginia electorate.

Nevertheless, Clinton may have found a purpose to these contests in addition to trying to improve her performance against Sanders: to connect with the working-class white voters who may be crucial in a general-election match-up against Trump.

In the run-up to West Virginia’s primary, Clinton toured the state, holding small, intimate meetings with voters — including some detractors who challenged her on the comments she made about coal miners.

Clinton proposed tax changes that would assist families with the cost of child care — a contrast with Trump’s lack of a specific policy agenda.

Among other details, Clinton said she would limit child-care costs to no more than 10 percent of a family’s income.

“It just doesn’t make sense,” Clinton said at a stop in Lexington, Ky., of the cost of high-quality care for young children and the struggles of working parents to pay for it. “It’s the most important job that any of us can do, and we’re making it really hard and really expensive.”

Bill Clinton was expected to tour Kentucky on Thursday.

The Clinton camp also sought to hold Trump to a tax platform that they called “risky, reckless and regressive,” anticipating that Trump may attempt to walk back some of those policies, including tax cuts for the wealthy.

“Donald Trump has put forward a tax plan that paces him squarely on the side of the super wealthy and corporations at the expense of the middle class and working families,” said Jake Sullivan, a senior Clinton policy adviser, in a call with reporters Monday.

Trump became the presumptive nominee after Sen. Ted Cruz (Tex.) and Ohio Gov. John Kasich dropped out following his victory in the Indiana primary last week. He has maintained a lighter schedule than usual since effectively securing the nomination. He visited West Virginia last week — only to ask Republican primary voters not to bother voting for him Tuesday.

“Save your vote for the general election, okay? Forget this one. The primary is gone,” Trump told a massive crowd in Charleston last week. He later made a swing through Oregon and Washington — continuing to target upcoming primary states while also, like Clinton, reaching out to white voters who are expected to play a big role in November.

Trump has also stepped up his attacks on Clinton. He has given her the nickname “Crooked Hillary” and has sharpened his attacks on her judgment, for instance on foreign policy, international trade deals and her vote for the Iraq War. He has also characterized her as an “enabler” of her husband’s indiscretions.

Once a Clinton stronghold, West Virginia’s political preference has shifted dramatically since she won by a landslide against Obama in the 2008 presidential primary.

Win or lose in the remaining contests, she is likely to maintain a significant lead over Sanders in both the votes and delegates necessary to clinch the Democratic nomination.

Sanders, in vowing to fight on, is eyeing the Democratic primary in California, where a huge delegate prize potentially awaits the winner on June 7. Sanders campaigned in Sacramento to a crowd of thousands on Monday. He rallied in Oregon Tuesday, and he was scheduled to campaign later in the week in South Dakota, which also votes in June.

“The political establishment is getting nervous,” Sanders said Monday. “They should be getting very nervous because real change is coming.”

Sanders made a pair of trips to West Virginia during the two weeks leading up the primary, where he emphasized jobs lost to trade deals and the persistent poverty in the state.

During his most recent trip, Sanders devoted a speech last week to the latter subject, staged at a food bank in McDowell County, where nearly half the children live in poverty. Sanders also touted a $41 billion plan to transition ailing coal workers into new industries.

In the lead-up to the West Virginia primary, Sanders also aired television ads in the state, something Clinton did not do.

Heading into Tuesday’s contest, Clinton held a formidable lead of 290 pledged delegates over Sanders, according to a tally by the Associated Press. Once superdelegates are factored in, Clinton’s lead stands at 774 delegates.

Clinton won the Democratic primary in Nebraska on Tuesday, but it was an “advisory” primary that followed caucuses in March at which Sanders won the majority of the delegates.

The more delegates Sanders accumulates between now and the Democratic convention in July, the more leverage aides say he will have in shaping the party’s platform. If he is not the nominee, Sanders has said, he would like to push Clinton to adopt his position on issues including universal health care and raising the minimum wage.

Sanders has continued to insist that he has a narrow path to the nomination that involves catching — or at least coming close to — Clinton in pledged delegates, which are allocated based on performances in primaries and caucuses. Sanders needs to win nearly two-thirds of the remaining pledged delegates to do that.

Gearan reported from Louisville and Lexington, Ky. Scott Clement, Jose A. DelReal and Emily Guskin contributed to this report.