(CNN) A federal judge in Alaska has ruled an executive order by President Donald Trump allowing offshore oil drilling of tens of millions of acres in the Arctic Ocean is "unlawful and invalid."

The ruling on Friday from US District Court Judge Sharon Gleason means a drilling ban for much of the Arctic Ocean off of Alaska will go back into effect.

On April 28, 2017, Trump issued an executive order reversing three memoranda and one executive order in 2015 and 2016 by then President Barack Obama withdrawing about 125 million acres of the Arctic Ocean from oil leasing. The Obama order also prevented drilling in certain parts of the Atlantic Ocean.

That action by the Obama Administration prompted strong criticism from some Alaska politicians and oil companies that wanted to drill there.

Ten environmental groups, including Greenpeace, the League of Conservation Voters, Sierra Club and The Wilderness Society, filed suit to block Trump's executive order. Defending the order were the Trump administration, the American Petroleum Institute and the state of Alaska.

Gleason ruled Friday that the Outer Continental Shelf Lands Act only allows a president to withdraw lands from consideration by the Interior Department for leasing -- not to revoke a prior withdrawal. She ruled Congress is the only institution that can reverse a president's decision with regard to this matter, saying Trump's executive order "is unlawful, as it exceeded the President's authority."

"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," Gleason said.

Gleason added the withdrawals in 2015 and 2016 "will remain in full force and effect unless and until revoked by Congress."

An Interior Department spokeswoman declined to comment citing pending litigation.

"While we disagree with the decision, our nation still has a significant opportunity before us in the development of the next offshore leasing plan to truly embrace our nation's energy potential and ensure American consumers and businesses continue to benefit from U.S. energy leadership," a spokesman for the American Petroleum Institute said in a statement to CNN.

League of Conservation Voters president Gene Karpinski touted the environmentalist win in a statement marking the latest court ruling against a Trump administration environmental move.

"This victory shows that no one, not even Trump, is above the law," Karpinski said in a statement. "Offshore drilling and the associated threat of devastating oil spills puts coastal economies and ways of life at risk while worsening the consequences of climate change. President Trump wanted to erase all the environmental progress we've made, but we fought back and we won."

The League of Conservation Voters also said the ruling would force the Trump administration to re-examine its five-year leasing program for the Outer Continental Shelf.

An appeal to the Ninth Circuit Court of Appeals is considered likely in the case.