BISMARCK, N.D. (AP) — The Army Corps of Engineers and the developer of the Dakota Access pipeline must complete an oil spill response plan for the stretch of pipe beneath the Missouri River in North Dakota, a federal judge ruled Monday.

U.S. District Judge James Boasberg’s order grants a request by the Standing Rock and Cheyenne River Sioux tribes for additional measures to protect the river’s Lake Oahe reservoir. The tribes draw drinking water from the lake and also consider it sacred.

Completion of a response plan and additional pipeline monitoring are warranted while the Corps determines the pipeline’s impact on the tribes, the judge said in his ruling. He cited in part the spill of 210,000 gallons (800,000 liters) of oil from the Keystone Pipeline in South Dakota last month. He ordered the environmental impact study in June.

“Although the court is not suggesting that a similar leak is imminent at Lake Oahe, the fact remains that there is an inherent risk with any pipeline,” Boasberg said.

Standing Rock Chairman Mike Faith applauded the judge’s decision, saying the pipeline “remains a clear and present danger.” Cheyenne River attorney Nicole Ducheneaux said the ruling acknowledges that the government and energy companies can’t be allowed to make decisions “without including stakeholders and the tribes to whom the United States owes a trust duty.”

The $3.8 billion Dakota Access pipeline began moving North Dakota oil through South Dakota and Iowa to a distribution point in Illinois in June. Texas-based developer Energy Transfer Partners maintains the pipeline is safe, and the company and the Corps had argued that tribal requests for additional protections at Lake Oahe were unnecessary or unwarranted.

Boasberg disagreed and ordered ETP and the Corps to work with the tribes on completing a spill response plan by April 1. He also ordered the company to work with the tribes to select an independent engineering company to review whether the project complies with federal laws and regulations. ETP must file bimonthly reports on the status of the pipeline.

“Each of the interim conditions is tailored to address the court’s ongoing concern with the risk of a spill at Lake Oahe,” said Boasberg, who added that the risk was “at the center” of his earlier decision to require more environmental study.

ETP spokeswoman Vicki Granado said in a statement that the pipeline “has been safely operating since early this summer” and declined further comment, citing an ongoing tribal lawsuit over the pipeline. Corps spokesman Mark Abueg said the agency was reviewing Boasberg’s order.