TALLAHASSEE — The Rick Scott who's running for the U.S. Senate in 2018 often bears only a hazy resemblance to the newcomer who burst on the scene and became governor of Florida eight years ago.

On a wide range of issues, Scott has shifted positions to adapt to changing political times, defying the conventional wisdom that Republican voters require rigid ideological purity from elected leaders.

He embraced environmental stands he once opposed, softened his hard-line stand on immigration, championed more money for schools he tried to cut, signed new gun restrictions he once opposed and changed course twice on expanding health care coverage under Medicaid — opposing it, favoring it, then opposing it again in the face of certain political defeat.

"He has evolved," said J.M. (Mac) Stipanovich, a strategist and lobbyist who advised two former Republican governors. "If you wrote a profile of Rick Scott in his first year in office and you wrote one this week, you'd be describing two starkly different men."

Stipanovich said Scott's evolution has been driven by politics.

By spending tens of millions of dollars on paid TV ads and relentlessly barnstorming the state in his private jet, the Republican governor has repackaged himself as he faces the toughest fight of his career against three-term Democratic Sen. Bill Nelson.

The outcome of the race could decide which party controls the Senate. Polls of likely voters show the race is a dead heat, with Scott and Nelson battling over a small pool of undecided voters in the nation's largest swing state.

Scott's favorable rating is as high as ever. He has achieved that in part by keeping his distance from an increasingly unpopular President Donald Trump.

It's another course correction for Scott, who embraced Trump in a glowing column in USA Today in January 2016, but recently took issue with the president's false denial of the hurricane death toll in Puerto Rico.

Some of Scott's most visible policy shifts concern Florida's environment, an issue that's more explosive than ever in 2018 because of ugly algae blooms and smelly red tide fouling waterways, driving away tourists and bringing small bands of protesters and hecklers to Scott campaign events.

On TV, on Twitter, and even on a floating billboard, Scott has gone on the offensive, blaming Nelson for "all talk, no action" on the state's ongoing environmental disaster.

Have you seen our new ad highlighting Bill Nelson's inaction on Lake Okeechobee? pic.twitter.com/TgIVkmQGOG — Rick Scott (@ScottforFlorida) August 5, 2018

But it was on Scott's watch that toxic green algae blooms twice invaded south central Florida and created crises that brought critical scrutiny to Scott's long environmental record.

As governor, Scott opposed stricter federal water quality rules, cut the budgets of five regional water management districts, abolished the state growth management agency, reduced state monitoring of waterways and repealed a septic tank inspection law.

Now, as a U.S. Senate candidate, Scott is suddenly steering millions of new state dollars to fight the red tide epidemic. There's skepticism about his late-term heroics as a defender of the state's fragile coastline.

"Scott is taking a page from Donald Trump's political playbook," said the Sierra Club's Frank Jackalone. "When he's got a position of weakness, he turns around and blames his opponent for his own mistake."

On offshore oil drilling, Scott declared another election-year victory after the Trump administration announced that it was exempting Florida from federal drilling plans.

"My top priority is to ensure that Florida's natural resources are protected," Scott said in January.

That was a stark reversal from a previous Rick Scott, who campaigned for governor in 2010 on a pro-drilling platform even after the Deepwater Horizon oil spill disaster brought black sludge to the Gulf Coast.

Texas and Oklahoma oil and gas executives have hosted campaign fund-raisers for Scott, and donated nearly $1 million to his Senate bid.

"I think it's pretty clear where he's going to be," Nelson said.

Scott deserves credit for his support for Everglades restoration and springs protection, said Colleen Castille, a top state environmental regulator under Gov. Jeb Bush and a onetime Scott critic. She gives his record on the environment a B-minus.

"We have to be proactive about keeping our waters clean," Castille said. "It's been more reactive than proactive."

Scott arrived on the political stage in 2010 not only as a job creator but as a cost-cutter — when the tea party was at the apex of its influence.

"Tea parties, 9/12 groups — you are changing the country, no ifs, ands or buts about it," Scott told thousands of cheering supporters at a rally in St. Augustine in 2010.

In his first year in office, at a time of double-digit unemployment and steep state budget deficits, Scott proposed a $3 billion cut in school spending. He will leave office in January boasting of historic school funding that's part of Florida's biggest budget ever, nearly $89 billion.

What changed?

"The economy," Scott campaign spokeswoman Lauren Schenone said.

"Gov. Scott led Florida through an incredible economic turnaround that helped create nearly 1.6 million jobs, pay down historic state debt and allow record investments to be made in what matters most, like education."

Scott declined to be interviewed for this report.

On immigration, Scott ran for governor in 2010 on a promise to enact a hard-line law against illegal immigration, patterned after one in Arizona.

He also criticized President Barack Obama for using his executive powers to protect young people known as Dreamers who came to the U.S. with parents who were illegal immigrants and faced being deported.

In 2014, when Scott was running for re-election, he reversed course and signed a law giving cheaper in-state tuition to immigrant students after opposing the idea in 2011, according to the independent fact-checking site Politifact Florida. Scott's turnabout was widely scorned by the conservative Republican wing in the Legislature.

"Gov. Scott has been clear that he supports securing our borders and protecting DACA kids," Schenone said. "Unlike Sen. Nelson, Gov. Scott believes legal immigration makes our country stronger while illegal immigration makes our country weaker."

Scott's turnabout was widely scorned by the Legislature's conservative Republican wing.

Scott has expanded his political outreach to immigrant communities such as Cuban-Americans and Venezuelans, and last week he made his eighth visit to Puerto Rico, on the one-year anniversary of Hurricane Maria.

Health care remains a closely-watched issue in Florida, a state with one of the nation's largest uninsured populations and millions of seniors who are on Medicare.

Scott says he doesn't want to go back to when pre-existing medical conditions disqualified people from getting insurance. But he has spent the past eight years calling for the repeal of Obamacare, which would have done just that.

An early opponent of expanding Medicaid, the federal-state program that insures poor adults and children, Scott made an abrupt about-face in 2013, calling it a "compassionate, common-sense step forward."

Facing a hostile Florida House, it failed, and by 2015 Scott was back on the other side.

"Rick Scott is hoping that Florida voters have amnesia about his record," said state Rep. Carlos Guillermo Smith, D-Orlando, an outspoken critic of Scott. "He's trying to tell us that he's a completely different person and he's got lots of money to make people believe it, but I don't think voters are going to buy it."

On guns, Scott also moved closer to the political center in the aftermath of the mass shooting that took the lives of 14 students and three adults at Marjory Stoneman Douglas High School in Parkland in February.

For years Scott enjoyed an A-plus rating from the National Rifle Association and was praised by the NRA's Marion Hammer for signing five pro-gun bills in the re-election year of 2014.

The NRA turned on Scott and sued the state after he signed a law in March raising the age to buy a gun from 18 to 21 and imposing a three-day wait on gun purchases.

Scott's shift on guns was a reaction to the Parkland shooting but also an acknowledgement that public sentiment in favor of gun restrictions was growing in Florida.

"I'm proud of the legislation we passed," Scott said in Tampa in April.

Contact Steve Bousquet at bousquet@tampabay.com and follow @stevebousquet.