Bernie Sanders has won the West Virginia primary in the Democratic race for the presidential nomination, US media project.
The Vermont senator still trails Hillary Clinton in the overall contest for delegates but this win keeps his slim hopes alive.
"We are going to fight for every last vote," he said in a victory speech that also attacked Republican Donald Trump.
Mr Trump was declared the winner in West Virginia and in Nebraska.
His last remaining rivals dropped out last week but remained on the ballot.
But Mr Trump faces a huge task in trying to get the Republican party behind him, as doubts persist about his substance and style.
House Speaker Paul Ryan, the party's highest-ranking elected official, has said he is unable to endorse the New York businessman because he lacks conservative principles.
With victories in Indiana and now West Virginia, Bernie Sanders has started another winning streak against Hillary Clinton. Like his five-state run in April, however, it will do little to slow her steady march to the Democratic nomination.
Exit polls show the West Virginia vote was particularly quirky. Almost 40% of Democratic voters there said they wanted a president less liberal than Barack Obama - and that group favoured avowed socialist Sanders by more than a two-to-one margin.
Mr Sanders also overwhelmingly carried the 27% who want a president more liberal than Mr Obama.
Such a result makes sense if some of Sanders's support is, in fact, an anyone-but-Clinton vote.
At this point the Vermont senator will likely take help wherever he can get it. He should be competitive in the next four contests, but could hit a wall in the June mega-prize, California. Its diverse electorate favours Mrs Clinton, and anything but an unprecedented Sanders win there would seal his fate.
Until then, however, Mr Sanders will continue to be a constant and unpleasant reminder to Mrs Clinton that there are Democratic voters still unwilling to fully get on board her campaign.