Judge Brian Morris of the U.S. District Court for Montana, who was appointed by Mr. Obama, handed environmentalists a huge victory by saying Mr. Trump's decision to sign the permit for the Canada-to-Texas pipeline shortly upon taking office did not have a sufficient basis.
The judge in the state of Montana said the Trump administration had "discarded" facts when it approved the Keystone XL Pipeline in 2017.
Trump, a Republican, said the project would lower consumer fuel prices, create jobs and reduce USA dependence on foreign oil.
The groups argued the U.S. State Department violated several acts in issuing a presidential permit for the pipeline without a proper environmental assessment of the changed route.
Moss ruled that a 2014 environmental review the Trump administration relied on to approve the project failed to fully take into account greenhouse gas emissions and climate change effects from the pipeline oil, ignored potential Native American resources that could be affected by the pipeline, lacked updated information on the risk of oil spills and failed to consider the effect of the price of oil on the current viability of the pipeline.
One of the plaintiffs, the Sierra Club, welcomed the judge's decision.
About 250 miles of pipeline would be buried across six counties in Montana.
‘Sarkar’ director AR Murugadoss moves Madras HC, seeks anticipatory bail
On Thursday night, Murugadoss had tweeted about the presence of police outside his house. Since I was not there they left the premises.
NPR reached out to TransCanada early Friday for comment on the ruling but did not hear back by the time of publishing.
TransCanada Corp's almost 1,200-mile pipeline has become one of the major battlegrounds in the climate change debate and, if completed, would carry an estimated 800,000 barrels per day from Canada's tar sands pits to Gulf Coast refineries in the US.
Environmental and indigenous groups sued TransCanada and the State Department in March to halt the project.
The same environmental analysis that the department carried out before denying the permit in 2015 was ignored when the department turned around previous year and approved it, the judge argued. He included pipeline leaks, the expansion of another pipeline called the Alberta Clipper and shifts in oil markets.
"An agency can not simply disregard contrary or inconvenient factual determinations that it made in the past", Morris wrote Thursday.
A presidential permit is required for infrastructure projects that cross worldwide borders.
The administration can appeal against the decision. Construction of the USA leg had been scheduled to begin next year.