FILE--In this Aug. 6, 2017, file photo, demonstrators against the Keystone XL pipeline march in Lincoln, Neb. Opponents of the proposed oil pipeline from Canada are asking a federal judge to force the U.S. government to turn over emails and other documents related to President Donald Trump's approval of the project. (AP Photo/Nati Harnik, file)

FILE--In this Aug. 6, 2017, file photo, demonstrators against the Keystone XL pipeline march in Lincoln, Neb. Opponents of the proposed oil pipeline from Canada are asking a federal judge to force the U.S. government to turn over emails and other documents related to President Donald Trump's approval of the project. (AP Photo/Nati Harnik, file)

BILLINGS, Mont. (AP) — Federal officials must go back and review documents related to the disputed Keystone XL oil pipeline, under a Wednesday court ruling that came after environmentalists accused President Donald Trump’s administration of withholding details on the project’s approval.

U.S. District Judge Brian Morris said the government must provide any relevant documents by March 21 or explain why they should be withheld.

The ruling came in a lawsuit pending in federal court in Montana from environmentalists seeking to stop the 1,179-mile (1,897-kilometer) pipeline. It would carry crude from Canada’s oil sands region to U.S. refineries.

ADVERTISEMENT

The project has become a flashpoint in the debate over climate change. It was blocked by former President Barack Obama in 2015 before President Donald Trump revived it last year.

U.S. Justice Department attorneys fought against releasing the sought-after documents. They said it could take more than six years and cost $6.3 million for officials to go through an estimated 5 million pages of documents that would need to be reviewed before they could be released.

Attorney Jackie Prange with the Natural Resources Defense Council said the government’s time and expense estimate was “vastly overblown” and included documents unrelated to Keystone.

“The public has a right to know what evidence and what materials were considered in making that decision (to approve the pipeline), especially when that decision has changed,” Prange said.

Even in cases where the government withholds documents, Morris said it must provide a “privilege log” that includes a cursory description of the documents and explains why they can’t be released.

A spokesman for pipeline sponsor TransCanada Corp. said the Alberta-based company does not comment on ongoing litigation.

The company announced last month that it hopes to begin construction in 2019.

The pipeline would run from Canada through Montana, South Dakota and Nebraska, where it would connect to an existing pump station in Steele City, Nebraska. From there, it would continue through Kansas, Oklahoma and Texas to deliver crude to Gulf Coast refineries.

___

Follow Matthew Brown on Twitter at www.twitter.com/matthewbrownap .