Hillary Clinton won the Kentucky primary Tuesday night in an exceptionally close race against Bernie Sanders, that kept news outlets from calling the race for hours after the polls closed.

Just before 9:30pm, NBC News called the race for Clinton, dealing a blow to Senator Bernie Sanders. With 99.8 percent of precincts reporting, Clinton led the Vermont senator by less than one percentage point, with 46.8 percent of the vote to his 46.3 percent. The difference amounted to approximately 1,800 votes, according to the secretary of state.

The extremely narrow victory in Kentucky, where 55 pledged delegates are available, will boost Clinton's 283 pledged delegate lead over Sanders, but not by much.

The candidates are also competing in Oregon on Tuesday night. Polls close there at 11pm EST.

Sanders can no longer win the nomination with the remaining pledged delegates alone and is counting on momentum in these final contests to help convince superdelegates to leave Clinton's campaign and support him instead. But as voters in Kentucky and Oregon were casting their ballots on Tuesday, the opposite happened: Emmett Hansen II, a superdelegate from the US Virgin Islands, announced that he was flipping from Sanders to Clinton, according to Bloomberg.

"There are no more windmills to joust against and no more mountains to climb," he said, after receiving a briefing from the Clinton campaign over the weekend on her plans for the island. "It comes down to one thing: what's best for the Virgin Islands, to be fully incorporated into the United States."

In Kentucky, Clinton's campaign was hoping for a repeat of the 2008 primary when the then-New York senator defeated Barack Obama by more than 30 points, despite ultimately losing the Democratic nomination that year. But the results of Tuesday did not match up to the campaign's ambitions this time round, after the former secretary of state committed a gaffe about the coal industry that sent her campaign on a back slide with voters in the Blue Grass State.

Kentucky has long been considered a friendly state to the Clintons. Bill Clinton actually won the state in twice in the general elections of 1992 and 1996, a feat his wife is unlikely to repeat as the state has grown more conservative in the last two decades. In recent days, the Clinton campaign has dispatched the former US president to stump for his wife at events across the state including in Owensboro, Frankfort, and Prestonsburg.

But lately, things haven't been so rosy for Clinton in Kentucky. The Democratic frontrunner received backlash from voters in coal mining country across Kentucky and West Virginia after she made comments about the industry made while campaigning in Ohio earlier this year. At a town hall in March, Clinton said that her clean energy policies would "put a lot of coal miners and coal companies out of business."

Clinton tried to rectify her comments earlier this month while campaigning in Appalachia, saying that she "misspoke" and that as president she would work to ensure that coal would "continue to be sold and continue to be mined."

Nevertheless, Clinton was met by angry protesters at an event in Williamson, West Virginia, last week and went on to lose that state's primary to Sanders by 16 points. Thirty-one percent of West Virginia voters in the Democratic primary identified as a member of a coal miner household, according to exit polls, and just under one-third of those households voted for Clinton.

Kentucky also has a large coal mining community, as one of the top three coal producing states in the US, but employment in the industry there has also been steadily declining along with production rates. Clinton's comments on coal sparked concerns in that state with local politicians and supporters, who moved to dissociate themselves from the remarks.

"I was very disappointed to hear the comments," Alison Lundergan Grimes, Kentucky's secretary of state and a close Clinton family friend, told the Associated Press after Clinton's initial statement. "My hope is she'll have a chance to clarify those comments, comments that as I said were completely out of line with personal conversations that I have had with her."

Grimes recently campaigned alongside Clinton in Kentucky along with former Governor Steve Beshear, who is also a Democrat and close friend of the Clintons.

Meanwhile, Sanders had been stepping up his discourse on employment and retirement protections for coal miners, as he campaign in Kentucky. Sanders repeatedly called on Senate Majority Leader Mitch McConnell of Kentucky to "drop his opposition" to a plan to keep pension benefits from being paid to more than 90,000 coal miners with the United Mine Workers of America throughout the US.

"The retirement funds have been jeopardized by coal company bankruptcies," the Sanders campaign wrote to reporters this week.

"We cannot allow the pension and retirement benefits of the United Mine Workers of America to be slashed," Sanders said in a statement. "When a worker is promised a pension we have a responsibility to make sure that promise is not broken."

Clinton's Kentucky win comes as her campaign has struggled to fight an election on two fronts against presumptive Republican nominee Donald Trump and Sanders, who has vowed to continue in the race through to the Democratic National Convention in July.

The Clinton campaign had ceased any advertising spending in the primary race against Sanders late last month, as the delegate race continued to surge in her favor, but switched tactics in Kentucky, dropping nearly $200,000 on ads in the lead-up to Tuesday night's primary. The campaign's rhetoric also shifted from a singular focus on Trump, resuming its discussion of the challenge posed by Sanders as well.

"Right now, Hillary is the only candidate waging two campaigns, which means we need twice as many resources as Bernie Sanders or Donald Trump," the Clinton campaign wrote in a fundraising email this week. "We need to build a massive campaign to take on Trump, and we need to finish this primary."

With just nine Democratic races remaining, including the major primaries in California and New Jersey on June 7, the Sanders campaign is running out of time to reverse Clinton's momentum.