This story has been updated.

TALLAHASSEE, Florida—Rick Scott appeared to have defeated Sen. Bill Nelson (D-FL) on Tuesday night, flipping a U.S. Senate seat that Democrats have held since 2001.

Nelson did not concede the race on Tuesday night, but Scott declared victory.

But by Wednesday morning, the race appeared to be headed for a recount, according to Nelson's campaign. According to unofficial results from the state’s Division of Elections, Scott is leading by 0.42 percent, or 34,500 votes. In Florida, an automatic recount is triggered when there is a less than .5% margin between candidates.

“We are proceeding to a recount,” Nelson said.

Scott's campaign called the move desperate.

Nelson, a 76-year-old former astronaut and U.S. Army captain, is seeking a fourth term and has trouble generating the enthusiasm needed to defeat Scott.

Scott has served as governor of Florida for the past eight years and is a close ally of President Donald Trump, who visited the state twice in the final week of the 2018 campaign to boost both Scott and Republican Gov.-Elect Ron DeSantis.

Scott was off of the campaign trail for much of the last month because he was assisting with hurricane recovery efforts in the Florida panhandle. Nelson attempted to take advantage of his absence and accused Scott of hiding from voters. However, Scott received high marks for his administration’s responses to major hurricanes in the state over the past eight years, and for Florida’s strong economy.

Scott campaigned not only by touting his record as governor, but by making the case that Nelson has been serving in public office for too long. Nelson is a moderate Democrat who opposes many of the more liberal positions that his party has embraced in recent years. At the same time, he has become less relevant among the key group of moderate legislative dealmakers on both sides of the aisle.

Trump, who defeated Hillary Clinton by one percentage point in Florida in 2016, helped to amplify Scott’s attacks on Nelson.

“REMEMBER FLORIDA: I have been President of the United States for almost two years. During that time Senator Bill Nelson didn’t call me once. Rick Scott called constantly requesting dollars plus for Florida. Did a GREAT job on hurricanes. VOTE SCOTT!” Trump tweeted on Monday.

In the weeks leading up to Election Day, Scott’s personal finances were the subject of a number of journalistic investigations. The New York Times reported that Scott’s blind trust—initially set up in order to avoid conflicts of interest from his past career as a health-care executive—still allowed him to have access to his investment accounts. Those disclosures apparently ultimately did not sway enough voters, even as Nelson accused Scott of using his office to enrich himself.

If Scott is officially sworn in, Florida will have two Republican senators, a bright spot for the GOP heading into 2020.