Washington CNN  — 

The Supreme Court on Monday cleared the way for several pipeline projects to proceed under a fast-track permitting process but excluded the controversial Keystone XL expansion from their ruling, forcing major delays.

Though the case is a partial win for the Trump administration, the exclusion of Keystone XL is a major defeat for a President who made good on a campaign promise to move forward with the project through executive order.

A federal judge in May sided with environmental groups, requiring that new oil and gas pipelines must undergo a lengthy permitting and regulation process in order to build across bodies of water.

That judge’s ruling canceled the so-called “Nationwide Permit 12” for several new pipelines, which authorized and fast-tracked work on pipelines that run across bodies of water. That ruling stated that the Army Corps of Engineers did not adequately consider the projects’ environmental impact on endangered species. The ruling required the projects that received such a permit to stop construction while the environmental impact study was completed.

The Supreme Court on Monday invalidated that lower court ruling in part, allowing many projects to go ahead while the environmental reviews are done, but excluded the Keystone XL. The Keystone XL pipeline must still abide by the arduous environmental review process, the justices ruled.

If lengthy enough, that process could jeopardize the pipeline’s existence, pending the outcome of the 2020 election. Democrat Joe Biden has pledged to rescind the permit for Keystone if he wins.

The targeting of Keystone by the Supreme Court represents the third loss in a week for Trump-supported pipeline projects. In January 2017, President Donald Trump signed executive actions that advanced both Dakota Access and the Keystone XL pipelines.

Earlier Monday, a district court ruled that the Dakota Access Pipeline must shut down by August 5 during an in-depth environmental review of the controversial project. The rare shutdown of an operating pipeline marks a major win for the Standing Rock Sioux Tribe and environmental groups that have fought fiercely for years against the oil pipeline. Opponents have argued the pipeline could contaminate drinking water and destroy burial and prayer sites of Native Americans.

And on Sunday, Dominion Energy and Duke Energy announced the cancellation of the Atlantic Coast Pipeline, a natural gas pipeline initially announced in 2014 that had been set to stretch hundreds of miles across West Virginia, Virginia and North Carolina.

The Keystone XL expansion project is no stranger to controversy. Facing pressure from environmental groups, President Barack Obama vetoed legislation that would have approved the project in February 2015 and rejected a presidential permit from the company attempting to build the project later that year. And in 2017, a total of 210,000 gallons of oil leaked from the existing Keystone Pipeline in South Dakota.

Right now, the Keystone Pipeline system stretches more than 2,600 miles from Hardisty, Alberta, Canada, east into Manitoba, Canada, and then down to Texas, according to parent company TransCanada. That pipeline already functions and transports crude oil from Canada. The proposed Keystone XL pipeline, which would stretch from Hardisty down to Steele City, Nebraska, would complete the entire proposed system by cutting through Montana and South Dakota.

CNN’s Eric Levenson and Ross Levitt contributed to this report.