The future of the project is still subject to the outcome of a likely legal battle. Groups that opposed the construction can appeal the commission's decision in state district court. It also remains to be seen whether the project is still commercially viable following three years of weak oil prices.

"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," TransCanada President and CEO Russ Girling said in a statement.

The Nebraska Public Service Commission voted 3 to 2 to approve a route for Nebraska's portion of the nearly 1,200-mile pipeline. However, the route approved was not TransCanada's preferred pathway for the pipeline.

The approval is also something of a victory for President Donald Trump, who overturned his predecessor's decision on a pair of controversial pipelines in the opening days of his presidency.

The Keystone XL pipeline passed a major hurdle on Monday after Nebraska regulators approved the route for the project, which faced opposition from environmentalists and the Obama administration.

Nebraska landowners fought a yearslong legal battle with TransCanada over the project. The company withdrew its application with the state's Public Service Commission in 2015 after the State Department blocked the pipeline. It submitted a new application with the commission in February after Trump issued an executive memo to advance the project.

The Keystone XL would bring oil from Alberta, Canada, to Steele City, Nebraska, where it would connect to an existing Keystone pipeline system. TransCanada shut part of the existing line last week after 5,000 barrels leaked from the system, contaminating land in northern South Dakota.

President Barack Obama refused to approve the cross-border project, saying the environmental review was not adequate in light of its route through the Sandhills ecosystem in Nebraska.

Former Secretary of State John Kerry denied TransCanada a presidential permit in November 2015, saying the Keystone XL would not have a major impact on America's energy security, lower gas prices or contribute meaningfully to the economy. At the same time, he said, the pipeline could impact local communities, water supplies and cultural heritage sites, and would facilitate the import into the United States of "a particularly dirty source of fuel."

TransCanada countered that the Keystone XL would create thousands of construction jobs and generate tens of millions of dollars in property taxes annually to counties along the route.

Environmentalists oppose the project because it will encourage the development of Canada's oil sands, a type of oil resource that requires more energy to tap than conventional reserves. The Keystone XL has become a lightning rod in a movement to discourage oil production by blocking pipelines, the primary way of transporting it to market.

"Today the Nebraska PSC chose to stand with Trump, climate denial, and Big Oil," Stephen Kretzmann, executive director of Oil Change International, said in a statement. "Good luck with that. Whatever happens now there is precisely zero chance that the global citizen, investor, and government momentum behind the Paris [climate agreement] goals and against the fossil fuel industry will be stopped."

Backers of the project say it will reduce U.S. reliance on oil from the Middle East and allow the country to fulfill its energy needs from one of its closest allies.

"Nebraska recognizes the Keystone XL pipeline is in the public interest bringing good paying jobs and more affordable energy for U.S. consumers," Andy Black, president and CEO of the Association of Oil Pipe Lines, said in a statement.

Commercial Viability

The business case for moving Canadian crude to the United States through the line has dimmed somewhat since 2015, and TransCanada has reportedly had trouble lining up customers.

"Pipeline construction would negatively affect TransCanada's business risk profile through increased project execution risk, and would likely put pressure on financial metrics," Gavin MacFarlane, lead analyst for TransCanada at Moody's Investors Service, said in a statement.

However, some analysts believe the project could still make sense.

Zachary Rogers, refining and oil markets research analyst at Wood Mackenzie, said Monday's decision "greatly diminishes political risk" for the project. He noted that some comments on TransCanada's latest earnings conference call suggest the company is satisfied with the number of commitments it has secured from customers.

"The pipeline's commercial viability is strengthened as declining heavy oil production in Mexico and ongoing Venezuelan risk has recently tightened the heavy-crude market in the Gulf Coast," he said in a briefing after the decision.

Pulitzer prize-winning oil analyst Daniel Yergin told CNBC last week the Keystone XL could help U.S. refiners secure heavy crude at a time when supplies from Venezuela are uncertain.

If exports from Venezuela are disrupted, "people will wish they had built the Keystone XL pipeline because it really is Canada that can make up for some of that," said Yergin, vice chairman at IHS Markit.