State regulators in Nebraska narrowly voted to approve the Keystone XL pipeline on Monday, five days after the original Keystone pipeline leaked 210,000 gallons of oil in South Dakota.

The Nebraska Public Service Commission voted 3-2 to give the project the go ahead, but rejected pipeline behemoth TransCanada’s preferred route. The decision promises to prolong the nearly decade-long battle over the tar sands pipeline and intensify the fight between the Trump administration and environmentalists.

“Today’s decision complicates TransCanada’s plans for the Keystone XL pipeline,” Greenpeace campaigner Rachel Rye Butler said in a statement. “While it isn’t clear what this ultimately means for TransCanada’s ability to build, one thing is certain ― people who oppose the new pipeline will throw everything they have got at stopping it.”

TransCanada must now submit an application for an alternative route or appeal the decision, a process that could take up to two years. The new route could face fresh opposition from landowners whose property wasn’t previously in the pipeline’s path and require environmental impact assessments.

“We’re incredibly encouraged,” Brian Jorde, a lawyer for the landowners opposed the pipeline, told HuffPost by phone. “The ball is in TransCanada’s court.”

If the company applies for a new route, he said, “we’ll have to go from there.”

In a statement, TransCanada CEO Russ Girling said the firm “will conduct a careful review of the Public Service Commission’s ruling while assessing how the decision would impact the cost and schedule of the project.”

Map: Getty Images / Graphics: Ji Sub Jeong/Huffpost Keystone XL would carry tar sands oil from Canada through Montana and South Dakota to Nebraska, where the conduit would link up to the Keystone Pipeline, which was completed in 2010. The highly pollutive oil would then go to refineries in Texas.

The five-member commission, which included just one Democrat, was barred from considering the spill under a state law heavily lobbied by TransCanada. Under that 2011 law, the officials were required to weigh “economic and social impacts,” compliance with state and local regulations, and evidence that the pipeline would damage or deplete natural resources. Safety issues, such as “the risk or impact of spills or leaks from the major oil pipeline,” could not influence the commission’s vote.

Opponents of Keystone XL, including environmentalists, Native American activists and ranchers who refused to allow the pipeline over their land, pointed to the spill in remote northeast South Dakota last Thursday as proof of the risk posed by the project. The roughly 5,000-barrel leak is the biggest disaster since the pipeline was completed in 2010.

Monday’s decision gives a boost to President Donald Trump’s plan to supercharge the fossil fuel industry in the United States, increasing oil and gas drilling, pipeline construction and coal burning. Four days after taking office in January, he signed an executive action inviting pipeline behemoth TransCanada to reapply for construction permits, and vowing to push for the controversial Dakota Access Pipeline.

In March, the State Department greenlighted Keystone XL, the same month the Army approved completion of Dakota Access without an environmental study. Construction finished on Dakota Access the next month, despite international outcry over the violent treatment of Native American activists and protesters who attempted to halt the project.

Hearings began in Nebraska this summer over whether Keystone XL served the state’s economic interests. Lawyers for TransCanada struggled to defend the project in August, failing to rebut attorneys representing the 90 landowners who opposed the pipeline when they debunked the number of jobs and amount of tax revenue it would generate.

NICHOLAS KAMM via Getty Images President Donald Trump signed an executive action in January meant to spur the construction of the Keystone XL and Dakota Access pipelines.

Even if it gets approval for a new route, TransCanada may still not even build the pipeline.

The company expects to spend $8 billion on the project, which would take nearly three years to build. The firm has already spent $3 billion on steel piping, land rights and lobbying. Pipelines make transporting crude cheaper, a critical revenue driver at a time of persistently low oil prices. But the oil industry doesn’t necessarily want Keystone XL anymore.

Canadian tar sands oil ― a prime target for activists and a frequently-struck bruise on Canadian Prime Minister Justin Trudeau’s environmental record ― could face new regulatory pressure in coming decades as climate change worsens, making the fuel a risky bet. That made moving crude out of Canada by rail a more attractive option, because train shipments don’t usually require long-term commitments.

Moreover, other pipeline projects moved ahead in the years Keystone XL languished and briefly died. Enbridge Inc. expects to finish an extension of its existing pipeline from Alberta to Superior, Wisconsin, by 2019, while Kinder Morgan Inc. plans to expand its Trans Mountain Pipeline from Alberta to the coast of British Columbia by 2020, according to The Wall Street Journal.

Former President Barack Obama rejected the Keystone XL pipeline in 2015 after a seven-year fight. During those years, environmentalists transformed the project into a rallying cry for land rights activists, water conservationists and climate scientists who warned that the particularly dirty tar sands oil that would be carried through the pipeline would exacerbate global warming.

The proposed 1,179-mile pipeline would carry tar sands oil from Alberta, Canada, to Nebraska, where it would connect with the existing Keystone pipeline and transport the product to refineries in Texas. Tar sands, also known as oil sands in Canada, are a noxious mix of sand, clay and bitumen, a thick, viscous oil. Keystone XL would carry 830,000 barrels in the U.S. per day, producing climate-changing emissions equivalent to putting 5.6 million new cars on the road, according to estimates by the environmental nonprofit Friends of the Earth.

The pipeline route traverses Nebraska’s Sandhills, an area of ancient prairies and sand dunes. It goes through the Ogallala Aquifer, the largest aquifer in North America, at times going underwater. The rock formation, spongey with gravel, silt, sand, and clay, formed 10 million years ago and replenishes very slowly from surface rivers and streams. The water level is close to the surface in Nebraska, making it especially vulnerable to a spill.

In a 2011 analysis, University of Nebraska professor Dr. John Stansbury found that TransCanada “made significant flawed and inappropriate assumptions about the frequency and severity of expected spills from its pipelines.” He estimated there would be at least two major spills per year, some potentially releasing as much as 180,000 barrels.

Water protection became a key theme in the fight against pipelines last year, when Native American activists in the Standing Rock Sioux Reservation battled for months to stop Dakota Access from cutting through a body of water held sacred by the tribe. Thousands descended on Washington, D.C., in March in a show of solidarity with the legions gathered at Standing Rock. Keystone XL, which has served as a symbolic rallying point for environmentalists since 2010, could build on that momentum.

“This decision mistakenly brushes aside the legitimate and serious concerns raised by Nebraska landowners and indigenous people that the Keystone XL pipeline would threaten their water and climate,” Anthony Swift, Canada project director at the Natural Resources Defense Council, said in a statement. “Only a couple days ago, we got yet another grim confirmation — oozing across the land in South Dakota — that pipelines leak. There’s no safe route for Keystone XL, and we will continue fighting with every tool, in every venue and with every partner, to make sure it’s never built.”