ORLANDO — Republican Ron DeSantis, who entered public office six years ago with the help of the conservative Tea Party movement, was elected Florida governor on Tuesday as President Donald Trump's choice to push back against a promised "blue wave" of Democratic opposition.

DeSantis narrowly defeated Democratic Tallahassee Mayor Andrew Gillum by less than 80,000 votes, with more than 8 million ballots cast. DeSantis received 50 percent of the ballots to Gillum's 49 percent, according to incomplete unofficial results.

The former congressman’s victory, which has secured four more years of Republican rule of Florida's top office, is a powerful testament to Trump’s influence in the country’s biggest presidential battleground.

Interested in this topic? You may also want to view these photo galleries:

Perhaps no other candidate in such a high-profile race in the country presented voters with a clear referendum on Trump's presidency. Trump chose DeSantis early, going against tradition by endorsing the lesser-known long-shot over a more established Republican candidate in the primary. And DeSantis embraced that support with commercials highlighting his fondness for the president and campaigning with him across the state.

Always considered a toss-up election, the race for governor quickly became beset by racial controversies after DeSantis made the infamous comment after his primary that voters shouldn't “monkey this up” by electing Democrat Andrew Gillum, the state’s first African-American gubernatorial nominee. DeSantis also struggled to distance himself from supporters who used racial slurs after Gillum and others argued it revealed the 40-year-old Republican's tolerance for racist rhetoric.

"Now, I'm not calling Mr. DeSantis a racist, I'm just saying the racists believe he is a racist," Gillum said during the last gubernatorial debate, weeks before the Nov. 6 election.

In the end, DeSantis’ victory put an end to the perceived “blue wave” momentum that was largely fueled by Gillum’s myriad of celebrity endorsements, big flow of cash from across the country and clear evidence of enthusiasm among Democrats in early voter turnout. Gillum managed to win big in all the state's major metropolitan areas, even flipping Duval County with a huge Democratic turnout in Jacksonville.

But the counter by Republican voters was too great. DeSantis won by motivating the state's Republican base instead of targeting moderates, breaking with what has long been considered the norm of Republicans moving to the center in general elections held in a state so evenly divided in its politics. DeSantis won big in traditional Republican counties, drawing large turnouts in reliable areas like Pensacola and Naples.

The Palm Coast Republican, who became a Tea Party favorite when he first ran for Congress in 2012, managed to keep most red counties won in 2016 by Trump, who has broadened the Tea Party movement into a bigger, more engaged movement of his own.

DeSantis, a father of two, frequently campaigned alongside his wife, Casey, a television host in Jacksonville. He successfully persuaded voters that his experience as an Iraq veteran, federal prosecutor and principled conservative was a better choice than Gillum, a mayor catapulted into the national spotlight as an unapologetic progressive.

With this Republican win, Floridians narrowly rejected what Gillum promised to be: a leader from the far left of the political spectrum who would champion the working class by raising the state's minimum wage to $15 an hour and expanding government-run Medicare to more citizens.

The outcome of the election also rebuked the ideas of Gillum, one of Florida's more liberal state candidates who advocated impeaching Trump and who adopted many of the far-left political proposals of U.S. Vermont Sen. Bernie Sanders.

Instead, voters endorsed the strict conservative ideology of DeSantis, who was a loud and frequent critic of the Obama administration while serving in Congress, an unabashed supporter of Trump and a proponent of long-shot legislative proposals that echoed his conservative principles, including term limits for U.S. House and Senate members.

During the campaign, DeSantis promised to continue the legacy of Republican Gov. Rick Scott by lowering taxes and cutting regulations, focusing on job and economic development. But as a candidate, DeSantis offered few details about his policy platforms.

He has promised to promote school choice in Florida’s educational system and to increase funding for Florida Everglades restoration projects. He also promised to punish local governments that do not cooperate with federal immigration enforcement. He vowed to implement a federal system that checks the legal working status of job applicants across the state to cut down on the hiring of undocumented immigrants.

During the campaign, DeSantis, who routinely chastised special perks in Congress, came under fire for refusing to disclose details about more than $145,000 in taxpayer-funded travel expenses incurred during his nearly six years in Congress. Details of that travel were not subject to open record laws because DeSantis, like every other member of Congress, received special exemptions.

While Democrats accused him of being unethical for using taxpayer money for trips that included Fox News appearances, DeSantis brushed off the story reported by the USA TODAY Network-Florida as a non-issue meant to distract.

DeSantis also faced criticism for attending conferences held by groups that hold extreme anti-Muslim views, including the David Horowitz Freedom Center's annual conference last November which he was paid to attend with his wife.

DeSantis argued he shouldn't be held accountable for what others say, and he defended his attendance at the gathering, which also included a war hero.

When he takes office in January, DeSantis will also get to pick three new justices to the state Supreme Court, appointments that could have an impact of the state’s balance of power for years to come.

For much of the general election, the nationally-watched race for governor became one about race and ideology between two unapologetic partisans, with the state's airwaves flooded with thousands of political ads.

Under the national spotlight, DeSantis repeatedly hit Gillum's record on crime by pointing Floridians to the crime rate in Tallahassee, the city he presides over. Gillum briefly suspended his campaign the weekend before the election after a gunman walked into a yoga studio and killed two patrons and injured others before killing himself.

DeSantis also highlighted an FBI investigation looming over Gillum's city. Gillum contended he was not a target of the federal probe, but DeSantis insisted it was evidence of the candidate being "corrupt."

Documents later were released during the campaign that showed Gillum knew he was receiving Broadway theater tickets from a man who said he was a developer seeking city business, but who actually was an undercover FBI agent.

Running as a fiscal conservative, DeSantis aggressively targeted Gillum's economic proposals that would have included an increase in the corporate tax rate from 5.5 percent to 7.75 percent to cast him as too liberal.

With the help of Trump, DeSantis and his fellow Republicans turned the socialist label and corruption into their go-to criticisms of the Democratic nominee.

On the last stretch of the election, DeSantis took a more divisive, but still energizing approach. His biggest events during the campaign's final week were two Trump rallies, one in Fort Myers and another in Pensacola. More than 8,000 people packed the Fort Myers rally, and thousands more in Pensacola.

In smaller campaign stops, DeSantis addressed supporters alongside Rudy Giuliani, the former mayor of New York City and now Trump attorney, and Florida Attorney General Pam Bondi, a Fox News favorite like DeSantis.

Before he was victorious on Election night, his first message to Floridians was a thank you and a request.

"Thank you everyone who is voting today. Vote for economic prosperity. Vote for a veteran and former prosecutor," DeSantis tweeted.