Image copyright AP Image caption The proposed pipeline would have connected to this pumping station in Nebraska

US President Barack Obama has announced he is rejecting an application to build the Keystone XL pipeline from Canada.

Speaking from the White House, he said it would not have served the "national interests" of the US.

Its construction has been hotly disputed for seven years, with environmentalists saying it would do irreparable damage.

But the president said the pipeline had taken on an "overinflated role" in the climate change debate.

The proposed pipeline would have run 1,179-miles (1,897km) taking 800,000 barrels of oil a day from Alberta, Canada, to Steele City, Nebraska.

But Mr Obama said it would not have:

lowered petrol prices

created long-term jobs

affected energy dependence

"The pipeline would not make a meaningful long-term contribution to our economy," he said.

Republican presidential candidates condemned the news, with Jeb Bush calling it an attack on the US economy.

In February, the Republican-led Congress voted to begin construction immediately, but Mr Obama vetoed the bill to await environmental reports.

Image caption Alberta tar sands in Canada, where the pipeline would have connected

Analysis: Anthony Zurcher - North America politics reporter

It took more than seven years, but Barack Obama has finally got to "no".

Maybe it was the election of a Liberal government in Canada that is more suspicious of big energy projects. Maybe it was the sharp decline in oil prices over the past year. Or maybe it was Friday's announcement that the US unemployment rate has dropped to 5%, the lowest of Mr Obama's presidency.

Whatever the explanation, the president decided now was the time to finally strike the death blow to the controversial pipeline. It's a move that will be heralded by environmentalists, condemned by Republicans on the presidential campaign trail and - almost certainly - largely overlooked by an American public that was never really engaged on the issue.

The president's decision puts Democratic presidential frontrunner Hillary Clinton in a comfortable spot. She had recently come out against the pipeline, and Mr Obama's move takes the issue off the table - at least for now.

The decision comes as world leaders plan to meet in Paris at the end of the month to finalise a major global climate agreement.

The agreement, which could be reached at the meeting known as the UN Climate Change Conference or COP 21, would be a major part of the president's legacy.

Video: Why does Paris climate change conference matter?

While the project is dead for now, the pipeline controversy will not end any time soon.

Proponents will almost certainly challenge the decision in court and if a Republican is elected president next year, construction could yet be approved.

The pipeline also generated controversy outside of Washington, souring relations between the former Canadian Prime Minister Stephen Harper and the US president.

President Obama said he had spoken to newly-elected Canadian Prime Minister Justin Trudeau and they agreed the issue of climate change trumped any differences of opinion over the pipeline.