The energy company behind the controversial Keystone XL pipeline is suing the U.S. government over the project. TransCanada Corp. began legal action Wednesday exactly two months after U.S. President Barack Obama denied the firm a critical construction permit, arguing that the proposed 1,179-mile pipeline was not in America’s national security interests.

TransCanada said it filed a lawsuit in U.S. Federal Court in Houston that claims Obama’s decision to deny construction of the pipeline exceeded his power under the U.S. Constitution. The lawsuit lists as defendants Secretary of State John Kerry, Attorney General Loretta Lynch, Secretary of Homeland Security Jeh Johnson and Secretary of the Interior Sally Jewell.

The company also accused the Obama administration of violating the terms of the North American Free Trade Agreement. TransCanada filed a Notice of Intent to begin a claim to recover “billions of dollars of damages” the company has suffered as a result of Obama’s “arbitrary and unjustified” decision, according to TransCanada’s news release and legal filings.

The Keystone XL pipeline, if built, would have connected Canada’s oil sands patch in the Alberta province to Steele City, Nebraska. The southern component of the pipeline — a $2.4 billion conduit from Cushing, Oklahoma, to refineries in Texas — began delivering oil in January 2014. Together the international pipeline would have carried up to 830,000 barrels of oil per day.

TransCanada-Keystone-Pipeline-System-Map-2015-06-08 The proposed Keystone XL pipeline would have connected Canadian oil sands producers to U.S. refineries on the Texas Gulf Coast. Photo: TransCanada Corp.

The Calgary-based builder said it was also reviewing the roughly 4.3 billion Canadian dollars ($3.1 billion) invested in the project and related assets. The company said it expects to record around 2.5 billion to 2.9 billion Canadian dollars in after-tax write-downs in its fourth-quarter results.

TransCanada first proposed building the pipeline in 2008 to help move heavy Canadian crude oil out of the isolated province and into global markets. But in recent years the project became a political land mine. Environmental groups staunchly opposed the project, arguing that its construction would unleash dangerous levels of greenhouse gas emissions into the atmosphere. Over time, the Keystone XL became a symbol of the country’s willingness to fight — or ignore — climate change.

Obama cited the climate in his Nov. 6, 2015, decision to deny TransCanada the crucial permit. "America is now a global leader when it comes to taking serious action to fight climate change, and frankly, approving this project would have undercut that leadership," the president said in a speech.

Supporters of the pipeline said it would create thousands of U.S. construction jobs and reduce North America’s reliance on imported oil. Jack Gerard, CEO of the American Petroleum Institute, the industry’s main lobbying group, said Tuesday the pipeline was a victim of “political ideology and preconceived notions” promoted by anti-fossil fuel advocates. “The decision to reject the pipeline simply ignores the pipeline’s many benefits,” Gerard told reporters at an energy summit in Washington.

TransCanada’s legal actions Wednesday come a day after South Dakota regulators again approved the 313-mile section of the Keystone XL pipeline that would pass through the state. The Public Utilities Commission initially issued a permit in 2010 that placed more than four dozen conditions on the project, but in June 2014, the approval lapsed.

South Dakota commissioners voted Tuesday to accept TransCanada’s guarantee that it can complete the project while meeting the conditions of the initial permit.

Environmentalists Wednesday were quick to criticize TransCanada's legal actions against the Obama administration. "The idea that some trade agreement should force us to overheat the planet's atmosphere is, quite simply, insane," Bill McKibben, co-founder of the advocacy group and a leading opponent of the project, said in a statement.