Donald Trump signed an executive order in April 2017 aimed at lifting the bans. (File)

US President Donald Trump's move to lift bans on drilling for oil and gas in offshore Arctic and Atlantic areas is illegal, a US judge has ruled.

Trump's effort to open more areas to drilling "is unlawful, as it exceeds the president's authority," Judge Sharon Gleason ruled.

As a result, bans on drilling in these areas "will remain in full force and effect unless and until revoked by Congress," the Friday ruling said.

Former President Barack Obama's indefinite prohibition on new drilling in US waters in the Arctic Ocean off Alaska, including most of the Beaufort and Chukchi seas, and in 31 underwater canyons in the Atlantic Ocean, was enacted in December 2016 under a 1953 law.

The Outer Continental Shelf Lands Act gives the president power to withdraw offshore areas from commercial use. Previous presidents Dwight Eisenhower and Bill Clinton also invoked the legislation.

Trump signed an executive order in April 2017 aimed at lifting the bans, saying it would pull in "billions of dollars" for America and create jobs.

"Our country's blessed with incredible natural resources, including abundant offshore oil and natural gas reserves, but the federal government has kept 94 percent of these offshore areas closed for exploration and production," the president said at the time.

"This deprives our country of potentially thousands and thousands of jobs and billions of dollars in wealth," he said.

Trump's 2017 order called for a review of the Obama-era bans with the goal of allowing "responsible development of offshore areas that will bring revenue to our treasury and jobs to our workers," but made no mention of the environmental rationale for the prohibitions.