U.S. Democratic presidential candidate Bernie Sanders defeated Hillary Clinton in the West Virginia primary on Tuesday, slowing her march toward the party's nomination.

Despite the setback, Clinton is still heavily favored to become the Democratic candidate in the Nov. 8 election.

But Tuesday's loss could signal trouble for Clinton with working-class voters in the U.S. Rust Belt, where she will need to prevail in key states such as Ohio and Pennsylvania when she takes on Trump in the general election.

Clinton in March said the country would "put a lot of coal miners and coal companies out of business" at an Ohio town hall in a comment that appeared to hurt her with voters in coal-mining states such as West Virginia.

During Clinton's visit to West Virginia and Ohio last week she repeatedly apologized to displaced coal and steel workers for her comment, which she said had been taken out of context, and discussed her plan to help retrain coal workers for clean energy jobs.

Trump, 69, won West Virginia handily on Tuesday, after his two remaining rivals, Ted Cruz and John Kasich, dropped out of the Republican race. Trump has zeroed in on Clinton's protracted battle with Sanders, a 74-year-old U.S. senator from Vermont who pulled off a victory in Indiana's Democratic primary last week despite trailing in opinion polls.

RELATED: Sanders rally draws thousands to Washington Square Park

Trump has taunted Clinton in recent days by saying she "can't close the deal" by beating Sanders, her only rival for the Democratic Party's nomination since Feb. 1.

Clinton, 68, has said she will ignore Trump's personal insults, including his repeated use of his new nickname for her, "Crooked Hillary," and instead will criticize his policy pronouncements.

To secure the Democratic nomination, a candidate needs 2,383 delegates. Going into West Virginia, Clinton, a former U.S. secretary of state, had 2,228 delegates, including 523 so-called superdelegates, elite party members who are free to support any candidate. Sanders had 1,454 delegates, including 39 superdelegates. Another 29 delegates will be apportioned based on West Virginia's results.

Clinton and Sanders will compete in another primary contest on May 17. Both candidates are also looking ahead to June 7 contests in which nearly 700 delegates are at stake, including 475 in California, where Sanders is now focusing his efforts.

Sanders has vowed to take his campaign all the way to the Democrats' July 25-28 convention in Philadelphia, and wants a say in shaping the party's platform.

Sanders has repeatedly told supporters at packed rallies that most opinion polls indicate he would beat Trump in a general election match-up by a larger margin than polls show Clinton defeating Trump.

Trump, shifting into general election mode, has already begun to consider running mates, and told the Associated Press on Tuesday that he had narrowed his list to five or six people who have legislative experience in Washington.

He has not ruled out picking New Jersey Governor Chris Christie, a former rival who ended his presidential bid in February. Christie, who endorsed Trump and then campaigned for him, on Monday was named to head Trump's White House transition team.

Trump is due to meet with U.S. House Speaker Paul Ryan in Washington on Thursday after Ryan said last week he was not ready to endorse Trump.

"We can't just pretend to be unified when we know we're not," Ryan said in an interview on Tuesday on The Michael Medved Show.

Trump said during an interview on Fox on Tuesday night that he would like Ryan to chair the party's July convention as planned. "He's a very good man, he wants what's good for the party," Trump said.