Saying that "the Keystone XL Pipeline would not serve the national interests of the United States," President Obama rejected the much-debated project on Nov. 6. (AP)

President Obama announced Friday that his administration will not issue a permit for construction of the controversial Keystone XL pipeline, arguing that approval would undermine the U.S. effort to curb greenhouse gases.

“America’s now a global leader when it comes to taking serious action to fight climate change,” Obama said. “And frankly, approving this project would have undercut that global leadership. And that’s the biggest risk we face — not acting.”

Denying TransCanada Corp. a permit for the 1,179-mile pipeline between Hardisty, Alberta, and Steele City, Neb., ends a seven-year fight over a project that became a symbol in the political battle over climate change.

[How Obama's decision adds momentum to the Paris climate talks]

Several former administration officials said Friday that Obama and Secretary of State John F. Kerry had decided to block the project two years ago but waited for the legally required internal review, a revised permit application and, finally, a politically opportune time to announce the decision.

Backers of the project said it would ensure a secure supply of oil from a reliable U.S. ally and create jobs; opponents said it would exacerbate climate change by releasing a massive amount of carbon into the atmosphere and would produce pollution hazards along the pipeline’s route.

What started as a routine permit application for a project to move 830,000 barrels of crude oil a day to Gulf Coast refineries became a political litmus test for Obama, who said Friday that the pipeline had taken on “an overinflated role in our political discourse.”

The State Department, which controls permits for projects that cross international boundaries, concluded that neither approval nor rejection of the project would significantly alter the globe’s overall carbon output or U.S. gasoline prices.

[Obama made up his mind against Keystone XL a year ago]

The first thing to know about the Keystone pipeline? It already exists. Here's a breakdown of the pipeline's various parts. (Gillian Brockell, Jhaan Elker and Kate M. Tobey/The Washington Post)

The president and his top advisers embraced the argument that environmentalists, top party donors and several Democratic lawmakers had made for years: that the United States could not press other countries to make sacrifices for the sake of the climate while locking in a steady supply of high-carbon oil through a major infrastructure project.

“The reality is that this decision could not be made solely on the numbers — jobs that would be created, dirty fuel that would be transported here, or carbon pollution that would ultimately be unleashed,” Kerry said in a statement. “The United States cannot ask other nations to make tough choices to address climate change if we are unwilling to make them ourselves.”

TransCanada’s president and chief executive, Russ Girling, issued a statement saying his company was “disappointed.”

“Today, misplaced symbolism was chosen over merit and science — rhetoric won out over reason,” Girling said. He did not say whether the firm would challenge the rejection in court or through trade arbitration procedures, but added: “TransCanada is reviewing the decision and its rationale.”

The rejection brought swift condemnation from Republicans, including House Speaker Paul D. Ryan (Wis.). “This decision isn’t surprising, but it is sickening,” he said in a statement, noting lost jobs. Obama “is rejecting our largest trading partner and energy supplier. He is rejecting the will of the American people and a bipartisan majority of the Congress.”

When TransCanada filed its application in September 2008, approval seemed assured. Only one U.S. environmental group, the Natural Resources Defense Council, initially opposed the permit, arguing that extraction and processing of bitumen into heavy crude was destroying swaths of Alberta’s boreal forest.

But in July 2010, the Environmental Protection Agency formally challenged the State Department’s climate analysis, giving environmentalists and a few Democratic lawmakers ammunition against the project. In August 2011, a grass-roots organization, 350.org, helped organize a White House protest where 1,253 people were arrested over two weeks.

Along with groups such as the National Wildlife Federation and the Sierra Club, 350.org stressed the energy-intensive nature of extracting thick bitumen by heating the oil sands. That process means tapping the sands emits more greenhouse gases than tapping conventional crude oil.

The issue began to galvanize young activists as well as deep-pocketed Democratic donors, such as billionaire Tom Steyer. White House officials became concerned about the political repercussions of approving the pipeline, and in November 2011 the administration said it would review alternatives to the proposed route, which crossed the Ogallala Aquifer that stretches across Nebraska and other Great Plains states. The aquifer is one of the world’s largest underground sources of fresh water and supplies drinking water to millions of people in the Plains. That review effectively delayed the decision until after Obama’s reelection.

The project, however, retained widespread support among Americans who believed that it would create large numbers of jobs. While the pipeline would have produced construction jobs for two years, it would have directly created no more than 50 permanent positions. Still, construction unions were strong proponents. Terry O’Sullivan, general president of the Laborers’ International Union of North America, said Friday that “Obama has also solidified a legacy as a pompous, pandering job killer.”

When congressional Republicans tried to force Obama’s hand by passing legislation in favor of the project, he vetoed the measure. By Feb. 13, 2013, the fight had taken on an almost surreal quality; that day in the Oval Office, the president asked his top energy and climate aide, Heather Zichal, about the celebrities and activists protesting at the White House gates.

“Do you remember the movie ‘Splash?’ ” Zichal replied, according to a participant in the meeting. “Darryl Hannah was just carted away to jail.”

Four months later, in a speech at Georgetown University, the president unveiled a comprehensive plan to tackle climate change. The last line added to the speech, as Obama rode from the White House to the campus, said he would approve Keystone XL only “if it does not significantly exacerbate the climate problem.”

By late 2013, Obama and Kerry had concluded that the pipeline failed their climate test — not because blocking it would guarantee that Canada’s fossil fuels would remain in the ground, but because denying the permit would strengthen America’s position in international climate negotiations.

Kerry, who has been a strong advocate for environmental protection throughout his career, did not weigh in for a few months after taking over at the State Department, according to several former administration officials. But in December 2012 at a Salvadoran restaurant, Las Placitas, on Capitol Hill, he sketched out on a napkin four goals he had if he became secretary of state. One of them, according to a former senior administration official, “was to elevate the environment as a foreign policy issue the way [Secretary of State] Hillary Clinton had with women.”

Kerry saw this “as a moral authority question,” added the official, who spoke on the condition of anonymity to discuss private conversations.

For environmentalists such as 350.org’s Bill McKibben, it was a sign that an energized movement could produce results.

“This was a huge, diverse campaign — the biggest environmental effort in decades,” McKibben wrote in an e-mail. “It began with no real hope of victory, and it finished with what one gas executive has called the ‘keystone-ization’ of almost every fossil fuel project in the continent, a growing resistance to an impossible future.”

The decision to reject the pipeline comes just two days after a new Canadian prime minister, Justin Trudeau, took office. Trudeau has said that he wants to see the project approved, while stressing that he does not intend for it to remain a sticking point in bilateral relations, in contrast to his predecessor, Stephen Harper.

Industry analysts are divided over what the decision will mean for oil development in Canada’s oil sands region, which already has been hit hard by lower global crude prices.

“Denial constitutes an extreme case of politicization of energy infrastructure permitting,” said Robert McNally, president of the Rapidan Group consulting firm and an energy expert on President George W. Bush’s National Security Council. “It will add what the industry calls ‘above-ground risk.’ It will not prevent the development of energy resources in Canada or the U.S., but delay and uncertainty will raise costs.”

Those costs have become more important as the price of oil has slipped. Rail transport has expanded to carry oil sands to the United States, soaring from just 16,000 barrels in 2010 to 51.2 million barrels in 2014 before dropping somewhat this year. But rail transport is more expensive than pipeline transport. And the extra cost looms larger in light of current oil prices, which are about half what they were for much of the past six years.

Yet the final rejection of the Keystone XL project was widely expected in the oil industry, and many companies have already made other plans. U.S. imports of oil from Canada hit a record high of 3.4 million barrels a day in August, up from just under 2 million barrels a day in 2008, the year the pipeline was proposed. That has happened even as U.S. domestic oil production has risen by more than half and despite delays in Keystone XL.

Democratic presidential hopefuls Bernie Sanders, Martin O’Malley and Hillary Rodham Clinton have come out against the project, and it could be revived only if a Republican won the White House and Trans­Canada reapplied. On Friday, GOP Sens. Marco Rubio (Fla.) and Ted Cruz (Tex.) both suggested that they would approve the project if elected president.

“This project, somewhat bizarrely, took on an almost mythical status as the ultimate political hot potato between Republicans and Democrats,” said Pavel Molchanov, oil analyst for the investment firm Raymond James. “But in actuality, it is simply not that big a deal in the grand scheme of things — not for U.S. refiners and not for oil sands producers.”

Royal Dutch Shell’s chief executive, Ben van Beurden, said last year that the company had bid for space on another pipeline to move its oil-sands crude to Canada’s east coast and from there to world markets, including Gulf Coast refiners. “We’re covered. I’m good,” he said in an interview. He said that “the argument that Keystone is a bad idea because it will somehow enable development of resources in Canada is to some extent flawed,” adding that other alternatives would emerge.

Yet pipeline projects across Canada have run into opposition and problems there, too. In October, Shell put aside a project that would have expanded its oil-sands production and took a $2 billion charge against earnings.