Protesters carry signs during the Peoples Climate March at the White House in Washington, U.S., April 29, 2017.

The legal battle has been brewing since December, when President Barack Obama issued an executive order that prevented much of the federally administered Arctic Ocean and parts of the Atlantic from being leased for fossil fuel exploration. Trump, then the president-elect, was widely expected to challenge the move.

A coalition of environmental groups sued President Donald Trump on Wednesday, arguing that he unlawfully rescinded his predecessor's executive order aimed at putting large swaths of U.S. waters off limits to oil and gas drilling.

In issuing its order, the Obama administration cited provision 12(a) of the Outer Continental Shelf Lands Act, which states, "The President of the United States may, from time to time, withdraw from disposition any of the unleased lands of the outer Continental Shelf."

That provision does not explicitly allow future executives to reverse their predecessors' action. The Obama administration essentially made a bet that a judge would determine Trump can't override its effort to permanently withdraw the areas from lease auctions.

As expected, Trump pushed back last Friday, signing an executive order aimed at making available for lease more of the U.S. Outer Continental Shelf, the parts of the ocean and seabed under federal jurisdiction. Among other things, it rescinded Obama's December order.

Now, environmental groups are asking the U.S. District Court of Alaska to prevent Interior Secretary Ryan Zinke and Commerce Secretary Wilbur Ross, also named as defendants in the suit, from executing the part of Trump's order that takes aim at Obama's offshore ban.

"We're aware of the complaint and reviewing it. We have no further comment," a Department of Justice spokesperson told CNBC.

The suit essentially takes the baton from the Obama administration, arguing Trump's order "exceeds his constitutional authority and his statutory authority under OCSLA, and is therefore ... unlawful"

"Until Trump, no president has ever tried to reverse a permanent withdrawal made under OCSLA, which does not authorize such a reversal," the conservation groups said in a statement.