Image copyright Reuters

The Trump administration has issued a permit to energy company TransCanada to build the Keystone XL pipeline.

The State Department said it had found the project, which was blocked by former US President Barack Obama, to be in the US national interest.

The 1,180 mile (1,900km) pipeline will carry tar sands oil from Canada to refineries on the Texas coast.

While announcing the approval President Trump called it a "great day for American jobs".

"TransCanada will finally be allowed to complete this long overdue project with efficiency and speed," Mr Trump said in the White House Oval office, joined by TransCanada officials and contractors.

TransCanada, a Calgary-based company, called Friday's decision "a significant milestone".

Chief executive Russ Girling, who stood behind Mr Trump at the White House, thanked him and said his company is "very relieved and very eager to get to work".

Mr Trump signed an executive order only days after taking office in January, designed to speed up final approval of the $8bn (£6.4bn) pipeline.

Secretary of State Rex Tillerson recused himself from the matter because of his previous role as chief executive of ExxonMobil.

The permit was signed by an undersecretary of state for political affairs, career diplomat Tom Shannon.

Image copyright Getty Images Image caption Activists rallied outside the White House in 2015 to thank Obama for blocking the pipeline

In denying the project in 2015, former Secretary of State John Kerry wrote that it would neither spur economic growth, nor help the US achieve energy independence.

He said it would threaten environmental damage by allowing "a particularly dirty source of fuel" to enter the US.

Canadian Prime Minister Justin Trudeau said he was "very pleased" with the pipeline announcement from the White House.

The project will be a benefit to both countries, he said, noting the US was seeking a partner to provide a "stable and reliable" source of energy.

"Canada will be that partner," Mr Trudeau said.

Not over yet - Analysis by Matt McGrath, BBC Environment correspondent

Making oil from the bitumen-rich Canadian tar sands is a messy and expensive business - separating the oil from the sand requires huge amounts of water and heat, and environmentalists say the process causes about 17% more greenhouse gas emissions than standard oil extraction. So how is green-lighting the XL pipeline to bring this oil to the Gulf Coast now serving the US national interest - when two years ago President Obama said it didn't?

Back in 2010, then Secretary of State Hillary Clinton said the Obama administration was "inclined" towards approval based on an assessment of environmental and economic impacts. For several years Mr Obama remained conflicted over the project, torn between opting for dirty-but-secure Canadian oil over cleaner-but-vulnerable Middle Eastern sources.

In November 2015, global warming gave Mr Obama a way out of the dilemma. Just a month before the key Paris climate meeting, John Kerry wrote that "moving forward with this project would significantly undermine our ability to continue leading the world in combating climate change." Mr Obama scrapped XL, and it helped persuade the world to sign the Paris Climate Agreement.

But the new administration has made clear that jobs and infrastructure top climate change as priorities. In January President Trump asked the State Department to re-assess the project and they found that the economic argument made sense. Mr Trump, struggling with healthcare reform, is very keen for a "win" on infrastructure and jobs, and the pipeline fits the bill.

However, completing the pipeline is not a foregone conclusion. The low price of oil makes XL (which stands for 'export limited' and not 'extra large') extremely expensive, while land rights and environmental objections may delay it for years.

Groundhog day for a keystone cop-out?

TransCanada still needs approval of the pipeline's route through the US state of Nebraska.

Mr Trump offered to call the governor of the state later today.

An evaluation by the US state department was required, because the pipeline crosses an international border.

Image copyright Getty Images Image caption Miles of unused pipe sits in a lot outside Gascoyne, North Dakota

TransCanada says the pipeline will create 13,000 jobs over two years, but opponents argue the vast majority of these jobs will be short-term work in the construction phase.

During the presidential election, Mr Trump embraced the idea that the pipeline would create American jobs.

He also signed a memorandum requiring Keystone to be built using American steel.

However, the White House later said this requirement would only apply to future applications, not projects already being built, such as Keystone.

A mandate to use US steel would not only have been more expensive for TransCanada, but could have led to US authorities being sued by the World Trade Organization.

White House spokeswoman Sarah Sanders said earlier this month: "Since this one is already currently under construction, the steel is already literally sitting there, it would be hard to go back."

The company said that roughly half the steel would come from US manufacturers.

Environmental groups criticised the decision, saying the potential damage from a spill is not worth any profit.

"This dirty and dangerous export pipeline would run right through America's heartland, threatening our water, our land, and our climate - all to pad the profits of a foreign oil company," said Tiernan Sittenfeld, from the League of Conservation Voters.

The project is expected to carry more than 800,000 barrels of heavy crude per day from Canada's Alberta province to the Gulf of Mexico.