The Keystone XL oil pipeline has been approved by the U.S. government, a full eight years and six months after Calgary-based TransCanada Corp. applied for a permit that was beset by political drama.

While critics warned the pipeline would lead to a dramatic increase in climate-warming carbon pollution, the energy company celebrated the news and announced it was dropping legal challenges against the U.S. government.

"This is a significant milestone for the Keystone XL project," said Russ Girling, TransCanada's president and chief executive officer in a statement. "We greatly appreciate President Trump's Administration for reviewing and approving this important initiative and we look forward to working with them as we continue to invest in and strengthen North America's energy infrastructure."

In his first week in office, President Donald Trump signed an executive order that invited TransCanada Corp. to reapply for a permit and promised a decision within 60 days. Since then, the president has repeatedly suggested he will accept the application.

The Associated Press reported that senior U.S. officials said the decision would come from Undersecretary of State Tom Shannon as his boss, former oil executive Rex Tillerson, recused himself from the decision.

That decision would clear the way for the White House to formally approve it. That's good news, said Jim Carr, Canada's Natural Resources Minister.

"This is a very good opportunity for us to move more Alberta crude south of the border," Carr told reporters in Ottawa on Thursday.

The Obama administration had rejected the pipeline after years of delay, after heated debates within the administration, street protests, and court battles tossing up resistance to the project.

The battle is far from over.

The pipeline company still does not have deals with all the landowners in Nebraska on the proposed route, lacks a permit in that state, and protesters promise they will be back to try thwarting the project.

"It still will be fought tooth and nail," said Clayton Thomas-Muller in a statement from anti-pipeline group

"Any politician siding with the fossil fuel industry on Keystone, be they named Trudeau or Trump, is in for one hell of a fight," Thomas-Muller said.

"An alliance of indigenous and climate action communities stopped (Keystone XL) before, and we will do it again," Greenpeace Canada climate campaigner Mike Hudema said in an emailed statement.

“Keystone XL would threaten the drinking water supply of millions of Americans, trample Treaty rights and accelerate greenhouse gas emissions on both sides of the Canada/US border," Hudema said. "President Obama rejected the Keystone Pipeline because of the threats it poses to the climate. We cannot let the Trump administration, supported by the Trudeau government, undo that progress."

Keystone XL is one of several ongoing pipeline projects intended to carry oil from Alberta to refineries and international markets; it would carry more than one-fifth of the oil Canada exports to the U.S., transporting it to refineries on the Gulf of Mexico.

Previous studies from the State Department have backed the views of industry that the pipeline wouldn’t significantly increase greenhouse gas emissions from Canada’s oilsands. But in 2015 the U.S. Environmental Protection Agency concluded that over its 50-year lifetime Keystone XL would lead to the release of about 1.3 billion more tonnes of greenhouse gases compared to a pipeline carrying conventional oil.

Carr said on Thursday that oil running through the pipeline would not exceed Alberta's legislated 100-megatonne cap on oilsands emissions.

But pipeline opponents point out that the State Department findings carried a more pessimistic caveat: that if no other pipelines got built, and oil prices remained low, then Keystone XL actually might lead to more production and therefore pollution.

"It’s time for Prime Minister Trudeau to show the climate leadership he promised," Hudema said.

Editor's note: This article was updated at 8:50 am on Friday with a new statement from TransCanada.