A federal court on Wednesday ruled that the environmental review for the controversial Dakota Access Pipeline (DAPL) was in part inadequate and must be reconsidered, handing opponents a partial legal victory. However, the pipeline may continue operations pending a further review.

The ruling by U.S. District Court Judge James Boasberg for the District of Columbia, who previously ruled twice against challenges by the Standing Rock Sioux Nation, prompted supporters and opponents to declare victory. Boasberg has requested a briefing next week about whether the pipeline, which is fully operational, should be allowed to continue flowing oil.

The Standing Rock Sioux and Cheyenne River Sioux, together with environmental supporters, have attempted to halt DAPL operations for months, arguing the pipeline threatens water quality as it crosses the Missouri River upstream from the Standing Rock Indian Reservation in North Dakota.

Boasberg’s ruling granted in part and denied in part motions by the Standing Rock Sioux and the U.S. Army Corps of Engineers (Army Corps), while denying a motion by the Cheyenne River Sioux Tribe. The judge wrote that “whether DAPL must cease operations during that remand presents a separate question of the appropriate remedy, which will be the subject of further briefing.”

DAPL supporters led by the Midwest Alliance for Infrastructure Now said the ruling had disposed of nearly all legal challenges, and the “handful” of claims upheld did “nothing to impact the ongoing operation of the pipeline, nor do they undermine the work of the more than 8,000 individuals across the four states who built it,” said spokesperson Craig Stevens.

Standing Rock Chairman Dave Archambault commend the court “for doing the right thing,” and the tribe called the ruling a significant victory. “We applaud the courts for protecting our laws and regulations from undue political influence, and will ask the court to shut down pipeline operations immediately,” he said.

After the Army Corps approved DAPL’s completion earlier this year, Standing Rock and Cheyenne River Sioux tribes filed a motion to set aside the approval, backed by the Trump administration.

Plaintiff attorneys from Earthjustice asked Boasberg to rule on at least two major legal arguments: whether the National Environmental Policy Act (NEPA) was shortchanged in granting an easement to the pipeline constructors and whether the federal approval violated a federal government treaty with the tribes.

Boasberg in his 91-page ruling said the Army Corps “substantially complied with NEPA in many areas,” but it has to more adequately consider the impacts of “an oil spill on fishing rights, hunting rights, or environmental justice, or the degree to which the pipeline’s effects are likely to be highly controversial.”

An appeals court in March refused a request to prevent the pipeline from operating, and Boasberg expressed his reluctance to force the DAPL permits and easement to be vacated because of the NEPA violation as it “would carry serious consequences.”

There is also a pending court challenge to the Iowa Utilities Board’s approval of DAPL that is awaiting a ruling by the state’s Supreme Court.