A federal judge in Alaska has declared that President Donald Trump’s executive order allowing offshore oil and gas drilling in the Arctic Ocean is “unlawful and invalid,” ruling that Trump “exceeded his authority.”

That means the drilling ban for millions of ocean acres established by former President Barack Obama will remain in effect.

U.S. District Judge Sharon Gleason ruled Friday that the Outer Continental Shelf Lands Act that determines offshore drilling access only allows a president to withdraw lands from consideration by the Interior Department for leasing — not to revoke a prior withdrawal. Obama withdrew some 125 million acres in the Arctic Ocean and North Atlantic coast from oil leasing in memoranda in 2015 and 2016.

Trump’s executive order reversing Obama’s action “is unlawful, as it exceeded the president’s authority,” Gleason wrote.

“The wording of President Obama’s 2015 and 2016 withdrawals indicates that he intended them to extend indefinitely, and therefore be revocable only by an act of Congress,” the judge said. The ban “will remain in full force and effect unless and until revoked by Congress.”

Environmentalists hailed the ruling.

“This victory shows that no one, not even Trump, is above the law,” Gene Karpinski, president of the League of Conservation Voters and one of the plaintiffs in the lawsuit contesting Trump’s action, said in a statement.

“Offshore drilling and the associated threat of devastating oil spills put coastal economies and ways of life at risk while worsening the consequences of climate change,” Karpinski said. “President Trump wanted to erase all the environmental progress we’ve made. But we fought back and we won.”