Updated

Florida’s long-time Democratic Sen. Bill Nelson conceded to Republican challenger Gov. Rick Scott Sunday, drawing the hotly contested race to represent the Sunshine State to a close after 12 days of legal wrangling.

According to the Florida Secretary of State's office, Scott led Nelson by approximately 10,000 votes after the state's 67 counties completed machine and manual recounts

Nelson, who served three terms in the U.S. Senate, met his match in Scott, who launched a competitive campaign for Florida votes. Scott, a two-term governor of the state, said Nelson called him to “graciously” concede and that Scott, in turn, thanked Nelson for his years of service. Scott has now won narrow victories in three statewide races since 2010.

“Now the campaign truly is behind us, and that’s where we need to leave it,” Scott said. “We must do what Americans have always done: come together for the good of our state and our country.”

President Trump congratulated Scott on Twitter Sunday, saying that Scott "was a great Governor and will be even a greater Senator in representing the People of Florida."

Nelson tweeted that "things turned out a little differently than we had hoped, but I by no means feel defeated ... I’ve had the privilege of serving the people of Florida for most of my life. It’s been a rewarding journey and a very humbling experience. No one could be more blessed."

Scott's victory also marks the first time in more than a century that Florida has two Republican senators representing them in Washington. The state is scheduled to certify results in the race on Nov. 20.

Election Day results showed Nelson trailing Scott by more than 56,000 votes. Scott’s lead narrowed to 12,603 votes after a statewide machine recount. The new numbers triggered an automatic hand recount under Florida law.

After it became clear that the race between Nelson and Scott would head to a legally required recount, Nelson and Democrats filed several lawsuits that challenged everything from Scott's authority over the state's election division to deadlines for mail-in ballots.

The Nelson campaign managed to secure only one win in court. U.S. District Judge Mark Walker gave voters until 5 p.m. on Saturday to fix their ballots if they haven't been counted because of mismatched signatures. Nearly 5,700 ballots were rejected because signatures on ballot envelopes did not match signatures kept on file by election officials.

Walker rejected a request by Democrats to automatically count all the ballots with mismatched signatures. He also rejected a request to waive deadlines for domestic mail-in ballots even if they had been mailed prior to Election Day. Under Florida law, ballots mailed inside the United States must be in election offices by 7 p.m. on Election Day in order to count. Overseas ballots are counted if they are received up to 10 days after the election.

Marc Elias, the attorney who represented Nelson, acknowledged on Twitter that "the margin narrowed, but did not close" as a result of the recount.

It’s unclear what Nelson’s plans will be post-race. The 76-year-old was first elected to office in a state House district near Cape Canaveral in 1972. He’s served three terms in the Florida House, six terms in Congress and was Florida’s insurance commissioner after Hurricane Andrew swept the Miami area.

The recount was marred by a series of missteps, particularly in Broward and Palm Beach counties, that put Florida back in the national spotlight 18 years after the dramatic 2000 presidential election.

After getting off to a slow start, embattled Broward County Supervisor of Elections Brenda Snipes boasted Thursday about making the state’s deadline for machine recounts.

“We are excited to be at this point,” she said Thursday afternoon.

A few hours later, election officials were forced to admit the county had uploaded the results of the recount two minutes after the state’s 3 p.m. cutoff -- making its machine recount tally void.

“Basically, I just worked my ass off for nothing,” Joseph D’Alessandro, Broward County’s election planning and development director, said.

D’Alessandro said he had a hard time uploading the results in time because he wasn’t familiar with the website used to send them to the secretary of state.

When asked what would happen if Broward missed Sunday’s deadline, county attorney Drew Myers inhaled deeply and told Fox News he couldn’t even entertain the idea.

“They have to make that deadline,” he said.

Broward’s bungled recount efforts had many calling for Snipes to step down, including former Florida Gov. Jeb Bush.

“There is no question that Broward County Supervisor of Elections Brenda Snipes failed to comply with Florida law on multiple counts, undermining Floridians’ confidence in our electoral process,” Bush tweeted on Monday. “Supervisor Snipes should be removed from her office following the recounts.”

Protesters have been camped outside Broward’s Lauderhill recount site since last Sunday.

Some carried signs that read, “Corrupt Snipes!!! Lock Her Up!” “Busted Brenda” and “I trust [Michael] Avenatti more than Brenda!” while shouting at election officials, counter-protesters and the news media.

President Trump also sounded off on Snipes, telling The Daily Caller, “When they call this woman incompetent, they’re wrong. She’s very competent but in a bad way.”

On Tuesday, Snipes said she’s considering leaving after the recount.

“It is time to move on,” she said. “I haven’t finalized that. I’ll just check with my family. They’ll tell me what I’m doing.”

Like Broward, Palm Beach County also missed its machine recount deadline.

Election supervisor Susan Bucher said the county found “dozens of precincts missing a significant number” of votes and indicated there may be entire boxes of ballots that weren’t counted, according to a report in the New York Times.

She also blamed the county’s issues on mechanical errors and said the scanning machine overheated. It got so bad that she had to fly in two mechanics to fix the problem. The technicians, though, witnessed Palm Beach County workers jam a paper clip into the scanner’s “enter” button to slow the high-speed scanner down. That action caused a short circuit that cut off the power.

U.S. District Judge Mark Warner, who heard several legal challenges filed in connection to the recount, slammed state lawmakers and Palm Beach County officials for failing to anticipate election problems and said the state law on recounts appears to violate the U.S. Supreme Court ruling that decided the presidency in 2000.

“We have been the laughingstock of the world, election after election, and we chose not to fix this,” Walker said in court.

While there have been no estimates yet on how much the 2018 recount will cost, past recounts have racked up a hefty bill.

In 2000, Citizens Against Government Waste released a report that estimated the costs associated with the state’s recount efforts. CAGW estimated Palm Beach County blew through $25,000 a day and projected the 2000 recount cost in Broward, Miami-Dade and Palm Beach counties to be more than $2 million.

Fox News’ Sarah Chakales, Ivonne Amor and Gregg Re contributed to this report.

The Associated Press contributed to this report.