TransCanada’s $8 billion Keystone XL pipeline got the go-ahead from the Nebraska Public Service Commission on Monday, clearing the last regulatory hurdle in a nine-year effort to build a line to carry thick crude oil from Alberta’s tar sands region to refineries on the Texas Gulf Coast.

But the five-member commission rejected TransCanada’s preferred route and voted to approve an alternative plan that would move the pipeline further east. The route of the new pipeline, which would carry 830,000 barrels a day of crude, would circumvent more of the state’s ecologically delicate Sandhills region.

The commission’s decision to back an alternative route could complicate TransCanada’s plans, forcing the pipeline company to arrange easements from different landowners. In its submissions, TransCanada had portrayed the alternative route as unworkable. Further litigation is likely.

“As a result of today’s decision, we 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,” Russ Girling, TransCanada’s chief executive, said in a statement.

But the commission’s decision could still enable President Trump to claim a victory on a campaign issue. Trump revived the project with an executive order during his first week in office and later gave it the required federal approvals.

In 2012, President Barack Obama approved the construction of the southern leg of the original Keystone XL pipeline proposal; it ran from Cushing, Okla., to Port Arthur, Tex. But in late 2015, he turned down TransCanada’s application to build a pipeline through Montana, South Dakota and Nebraska, citing climate concerns and Nebraska’s ecological concerns.

The 3-2 commission decision comes just four days after a rupture in the existing Keystone pipeline also owned by TransCanada leaked an estimated 5,000 barrels of crude oil in a rural part of northeast South Dakota. The spill, the latest in a series of leaks on the existing pipeline, raised concerns about other potential spills, economic impact and climate change.

The independent commission had come under pressure from the Nebraska state legislature and labor unions to approve the pipeline while environmental groups and prairie populists have vowed to appeal, if necessary, to the courts and follow that up with civil disobedience.

The commissioners who voted for the pipeline permit included Frank E. Landis Jr., a lawyer first elected in 1988; Rod Johnson, a former Republican state legislator; and Tim Schram, a former county commissioner. The pipeline was opposed by newly elected Mary Ridder, a cattle rancher from the Sandhills region, and Crystal Rhoades, who has worked with a variety of community organizations before becoming a commissioner.

While the approved alternative route would largely avoid the Sandhills, it would still cross small shallow parts of the Ogallala aquifer, the main source of drinking and irrigation water in Nebraska and much of the Great Plains.

In her dissent, Rhoades said she opposed the pipeline regardless of the route. She said that the pipeline was not in the state’s public interest, that jobs would not go to Nebraskans, that it would create “significant burdens” on landowners whose use of the pipeline corridor would be limited, and that she was still worried about the environmental impact.

“All human-made infrastructure degrades and fails over time,” she wrote. “No infrastructure ever designed has lasted for eternity and there is no reason to believe this pipeline will be an exception.” Rhoades acknowledged that the commission was not supposed to weigh the risks of spills, but she said the state’s Department of Environmental Quality had included it in the record.

While TransCanada has promoted the pipeline project as a jobs creator, Rhoades said that “there was no evidence provided that any jobs created by the construction of this project would be given to Nebraska residents.”

She also said that TransCanada had failed to consult Nebraska’s Native American tribes. She noted that the company said it had consulted with the Southern Ponca Tribe, but Rhoades said that resides in Oklahoma. “This is the equivalent of asking a distant relative for permission to do a major construction in your backyard,” she wrote.

The impetus for the controversial pipeline has been to provide transportation for the thick bitumen produced in Alberta to the Gulf Coast. Many oil sands producers currently ship crude by railroad, which is not immune from accidents. Pipeline transportation is also cheaper than rail.

“Nebraska’s decision today greatly diminishes the political risk for the project, likely clearing the way for increased volumes of West Canadian heavy crude to reach the Gulf Coast,” Zachary Rogers, refining and oil markets research analyst at Wood Mackenzie, said in an email.

The Association of Oil Pipe Lines hailed the decision, saying that sales of construction equipment in Nebraska would generate $16.5 million in tax revenue for state government. In its first full year of operation, the Keystone XL would generate $11.8 million in additional property taxes for counties in the state of Nebraska, the group said.

But critics said that the property where the pipeline would cross would lose value. And climate change activists are trying to block increased output in the oil sands region, where high amounts of energy are needed to extract the oil.

David Domina, who represented landowners before the commission, called the commission’s decision a victory. “TransCanada had the burden of proof and its proof failed,” his firm said in a statement. The firm said that any party could appeal the PSC order within 30 days. The Court of Appeals would then review the matter without a jury and using only the record created during the PSC hearings.

Rhoades said the new route would create new problems because there are an estimate 40 landowners along who did not know they lie along the new pipeline path.

The Sierra Club also greeted the commission’s decision as a partial victory. It said in a statement that during its testimony in the PSC’s public hearings, TransCanada had “argued that building along an alternative route would be unworkable, and will now need additional easements if the company tries to proceed with the project.”

The Sierra Club added that it would oppose the pipeline along any route because “the pipeline would transport dirty, climate-polluting tar sands through Nebraska to the Gulf Coast for export, threatening land, water, and communities along the way.”

“It is a huge victory for us today,” Jane Kleeb, longtime foe of the pipeline and now head of the Nebraska Democratic Party, said in an email. She said “it opens all sorts of legal challenges.”