Image copyright AFP Image caption During the 2016 campaign, Mr Trump promised to reverse his predecessor's environmental protection policies

Donald Trump's reversal of an Obama-era environmental protection was "unlawful", a judge has ruled.

During his presidency, Barack Obama brought in a ban on offshore drilling in parts of the Arctic and Atlantic.

Mr Trump attempted to overturn this with an executive order in 2017, promising to allow oil and gas companies back into protected regions.

District Court Judge Sharon Gleason has now ruled that the president violated a federal environmental law.

What was 'unlawful' about what Trump did?

The court heard that Mr Trump fell foul of the federal Outer Continental Shelf Lands Act.

Under that law, presidents are allowed to withdraw areas from the national oil and gas leasing programme, which allows companies to drill in specified areas.

Mr Obama had used this law to protect almost 500,000sq km of the outer continental shelf - including the Arctic's Chukchi Sea, the Beaufort Sea, and a large area of the Atlantic Ocean on the country's east coast.

Image copyright Getty Images Image caption Oil wells and vehicle-charging stations in Deadhorse Prudhoe Bay in Alaska, on Beaufort Sea, where drilling was banned

However, presidents do not have the power to add areas back to the leasing programme - only Congress does.

Judge Gleason told the court that therefore the ban on drilling "will remain in full force and effect unless and until revoked by Congress".

The ruling was the result of a lawsuit brought by a coalition of Alaskan indigenous and environmental groups.

Athan Manuel, from a group called The Sierra Club, told US broadcaster CBS that the ruling was "great news for the Arctic Ocean, great news for the planet, great news for the fight against climate change".

'Unleash American energy'

Getting rid of Mr Obama's environmental protections had been one of Mr Trump's promises to voters while on the campaign trail ahead of the 2016 election.

He signed the executive order allowing oil and gas giants access to the protected areas in April 2017, just a few months after his January inauguration.

At the time, Mr Trump told reporters that he wanted to "unleash American energy". Environmental groups immediately announced that they would challenge the move.

Mr Trump had also attempted to overturn another environmental ban brought in by his predecessor, which would have allowed his administration to build a road through sensitive wetlands in the Izembek National Wildlife Refuge in Alaska.

However, that move has also now been blocked by Judge Gleason.

Mr Obama enacted that ban after a four-year impact study into the area, which found that the road would cause unjustifiable harm.

Judge Gleason told the court that Mr Trump's former Interior Secretary Ryan Zinke then broke the law when he reversed the policy without addressing the findings of this study.