Energy Transfer LP’s fight to stave off a shutdown of the Dakota Access oil pipeline now heads to a federal appeals court after a district judge on Thursday refused to cut the company a break.

Judge James E. Boasberg of the U.S. district court in Washington rejected a request to freeze his July 6 order that operations of the pipeline be halted by Aug. 5.

Energy Transfer has already launched a challenge at the U.S. Court of Appeals for the District of Columbia Circuit, and will now ask that court to sideline the shutdown order for the duration of the appeal.

The company could ask the Supreme Court to step in if the appeals court declines to do so.

Energy Transfer lawyers have called Boasberg’s order unprecedented. If upheld, it would mark the first time a major oil and gas pipeline has been forced to shutter because of violations of the National Environmental Policy Act.

The order requires the pipeline to stop the flow of oil while the Army Corps of Engineers conducts a new environmental review, a process expected to stretch into 2021.