The ruling by Judge Brian Morris of the US District Court for the District of Montana dealt a stinging setback to Trump and the oil industry and served up a big win for conservationists and indigenous groups.
However, President Donald Trump reversed the decision shortly after taking office, saying it would bring thousands of jobs.
"This is a complete repudiation of the Trump administration's attempts to evade environmental laws and prioritize oil company profits over clean water and wildlife", said Jared Margolis, senior attorney with the Center for Biological Diversity, which is part of a coalition of environmental and native groups that have attempted to stymie the pipeline. The Trump administration claimed, with no supporting information, that those impacts "would prove inconsequential".
Shawnee Rae, age 8, among a group of Native American activists from the Sisseton-Wahpeton tribe protesting the Keystone XL Pipeline in Watertown, S.D.in 2015.
Delays also may send TransCanada back to oil producers or Canada's government for assurances that the trouble of trying to push ahead with the pipeline will be worthwhile, according to Royal Bank of Canada's Robert Kwan.
In August, Morris ruled that the State Department was obligated to "analyze new information relevant to the environmental impacts of its decision" to issue a permit for the pipeline a year ago. The Obama-appointed judge specifically called out State's disregarding the climate change arguments against the pipeline it had made under Mr. Obama.
TransCanada, which is pushing the project, did not immediately respond to a request for comment early Friday. "We remain committed to building this important energy infrastructure project".
The 1,897-kilometre pipeline would transport up to 830,000 barrels of crude a day from Alberta and Montana to facilities in Nebraska.
In 2015, on the eve of the global climate talks in Paris, the Obama administration appeared to bring an end to the seven-year-long saga when it announced it was halting construction of the pipeline, arguing that approval would compromise the country's effort to reduce its greenhouse gas emissions.
Morris ruled the Trump administration "jumped the gun" by pushing forward with the pipeline despite concerns over damage to native American heritage and the resulting release of greenhouse gases. There's simply no excuse for approving this awful project.
"The Department instead simply discarded prior factual findings related to climate change to support its course reversal", Morris wrote.
The administration can appeal against the decision. "That's why we keep winning in the court".
Mystery deepens on Lion Air crash after Boeing bulletin
Lion Air is one of Indonesia's youngest airlines but has grown rapidly, flying to dozens of domestic and worldwide destinations. An Indonesian official said both the plane and the two pilots aboard have been grounded while an investigation is underway.
One dead, two injured in Melbourne stabbing rampage
A Melbourne-based reporter tweeted that nearby buildings were placed on lockdown by the police following the incident. One video showed the man repeatedly lunging at police officers with what looked to be a knife.