President Trump, who barely two years ago proposed a vast expansion of oil and gas drilling in U.S. continental waters, on Tuesday made clear there is at least part of the nation’s coastline he is eager to protect: the crucial electoral battleground of Florida.

Trump on Tuesday announced plans to extend a moratorium on oil drilling in the eastern Gulf of Mexico, an area that includes the Sunshine State’s west coast, as well as expanding it to include the Atlantic coasts of Florida, Georgia and South Carolina.

The move marks a stark reversal for Trump as he seeks to shore up votes in the tightly contested state ahead of the Nov. 3 election. For a president who has spent much of his first term working to expand U.S. oil and gas drilling and scale back Obama-era regulations on the fossil fuel industry, the move also underscores the political reality in Florida, where Republican governors have opposed oil exploration off their shores, fearing it could imperil beaches and harm the tourism-dependent economy.

“It’s an order that does so much for the state of Florida,” Trump said Tuesday during remarks in Jupiter, Fla. “This protects your beautiful Gulf and your beautiful ocean, and it will for a long time to come.”

Though Tuesday’s action might please many voters and elected officials in the states where Trump said he would impose the moratorium, it is likely to deepen frustration in other states that have long sought assurances that oil rigs won’t rise off their coastlines.

Alena Yarmosky, spokeswoman for Virginia Gov. Ralph Northam (D), said the commonwealth has been asking for a comprehensive federal offshore drilling ban for years to no avail.

“This is about protecting our environment and the critical jobs that depend on our coast, including the seafood, aerospace, and defense industries,” Yarmosky said in an emailed statement. “Protecting our coastline isn’t a partisan issue — and it shouldn’t be treated as such.”

Democratic presidential nominee Joe Biden was among those who accused Trump of acting out of political expediency, rather than genuine environmental concern.

“Just months ago, Donald Trump was planning to allow oil and gas drilling off the coast of Florida,” Biden tweeted Tuesday afternoon. “Now, with 56 days until the election, he conveniently says that he changed his mind. Unbelievable.”

Biden has proposed going further than Trump by promising to ban new leasing on all federal waters and lands — not just those off Florida, Georgia and South Carolina.

By banning exploration in the eastern Gulf of Mexico, Trump finds himself at odds with the oil and gas industry, normally his political ally, which for years has eyed the region off Florida as one of the country’s best untapped offshore reservoirs.

“Our preference should always be to produce homegrown American energy, instead of deferring future production to countries like Russia and Iran, which do not share American values,” said Erik Milito, head of the National Ocean Industries Association. “Limiting access to our offshore energy resources only shortchanges America and dulls our national outlook.”

In 2006, Congress put a moratorium on oil leasing in the eastern Gulf. But that ban expires in 2022.

Environmental advocates, meanwhile, argued Tuesday that Trump’s extended ban doesn’t go far enough.

“This is not a reason to celebrate, because oil spills don’t stop at state lines,” Sierra Weaver, a senior attorney with the Southern Environmental Law Center, said in a statement, noting that oil from the Deepwater Horizon spill in 2010 reached five states. “As long as any part of the Atlantic coast is open to drilling, all Atlantic states are at risk. Keep the champagne corked until the entire Atlantic coast is protected.”

In early 2018, The Trump administration unveiled a controversial proposal to permit drilling in most U.S. continental-shelf waters, including protected areas of the Arctic and the Atlantic, where oil and gas exploration is opposed by both Republican and Democratic governors up and down the East Coast.

“The initial version they outlined was incredibly aggressive,” said Kate Kelly, public lands director at the liberal think tank Center for American Progress, noting that only one portion of water off the coast of southwest Alaska would have been off-limits to drillers.

The draft five-year Outer Continental Shelf Oil and Gas Leasing Program, which would have lifted a ban on such drilling imposed by President Barack Obama near the end of his term, was embraced by oil and gas industry groups but faced immediate resistance, not only from environmental advocates but also from elected officials across the political spectrum.

After Florida’s then-Gov. Rick Scott (R) made clear his opposition, the Trump administration soon exempted the state from the dramatic expansion of drilling leases across 90 percent of the U.S. outer continental shelf. That left other angry officials asking why only the Sunshine State got a reprieve.

“We cannot afford to take a chance with the beauty, the majesty and the economic value and vitality of our wonderful coastline,” South Carolina Gov. Henry McMaster (R), who backed Trump in his state’s competitive 2016 primary, said in a statement at the time.

“We’ve been clear: this would bring unacceptable risks to our economy, our environment, and our coastal communities,” North Carolina Gov. Roy Cooper (D) wrote in a tweet.

State lawmakers, mayors and city councils along the Eastern Seaboard mobilized in an attempt to stop the administration’s plan.

The White House’s initial proposal stalled under legal pressure. A federal judge in early 2019 ruled that Trump’s revocation of a ban on oil and gas drilling in the Arctic and Atlantic oceans was illegal, saying Congress would need to step in to reverse the Obama-era ban.

Interior Secretary David Bernhardt said at the time that a federal district court ruling out of Alaska against the administration effectively stalled Trump’s offshore drilling ambitions.

The president’s announcement Tuesday came amid a speech in which Trump portrayed himself as a fierce protector of America’s natural resources and a steward of the environment.

“Environmental protection is a sacred obligation,” said the president, referring to himself as a “great environmentalist.” He noted how he had signed a bipartisan bill to tackle a maintenance backlog at national parks and fund conservation efforts, overseen the cleanup of dozens of the country’s most polluted sites, revamped regulations aimed at reducing lead in drinking water, and backed a global effort to plan a trillion trees.

Critics were quick to point out that the Trump administration also has rolled back scores of key environmental regulations, including weakening federal fuel efficiency standards for the nation’s automobiles and easing curbs on emissions from the nation’s power plants. He has rejected growing calls from scientists — including those inside the government — to take seriously the economic and security threats that the warming climate poses to the nation. He has bolstered the fossil fuel industry, criticized renewable technologies such as wind power and moved to withdraw the United States from an international effort to cut greenhouse gases that fuel global warming.

“Donald Trump thinks he can con voters into giving him a pass on four years of environmental failure,” Kevin S. Curtis, executive director of the NRDC Action Fund, said in a statement Tuesday afternoon. “It’s been a disaster for Floridians, who are paying the price for the climate crisis — rising seas, flooding, algal blooms, supercharged storms and more — with worse to come if Trump gets four more years.”

Speaking only a few miles away from his Mar-a-Lago resort, Trump also bragged about federal money he authorized to help restore and protect South Florida’s Everglades, including a dike at Lake Okeechobee.

But the Trump administration actually sought to eliminate that specific funding earlier in his tenure. Lawmakers restored it after the White House cut it out of its budget requests to Congress. The White House amended its budget proposal last year after touring the lake and hearing from Sen. Marco Rubio and other Republican members of Congress from Florida who pushed to restore the money.

Philip Rucker contributed to this report.