WASHINGTON (AP) — Ending a seven-year political saga, President Barack Obama killed the proposed Keystone XL pipeline on Friday, declaring it would have undercut U.S. efforts to clinch a global climate change deal at the center of his environmental legacy.

Obama's decision marked an unambiguous victory for environmental activists who spent years denouncing the pipeline, lobbying the administration and even chaining themselves to tractors to make their point about the threat posed by dirty fossil fuels. It also places the president and fellow Democrats in direct confrontation with Republicans and energy advocates heading into the 2016 presidential election.

The president, announcing his decision at the White House, said he agreed with a State Department conclusion that Keystone wouldn't advance U.S. national interests. He lamented that both political parties had "overinflated" Keystone into a proxy battle for climate change but glossed over his own role in allowing the controversy to drag out over several national elections.

"This pipeline would neither be a silver bullet for the economy, as was promised by some, nor the express lane to climate disaster proclaimed by others," he said.

Although Obama in 2013 said his litmus test for Keystone would be whether it increased U.S. greenhouse gas emissions, his final decision appeared based on other factors. He didn't broach that topic in his remarks, and State Department officials said they'd determined Keystone wouldn't significantly affect carbon pollution levels.

Instead, the administration cited the "broad perception" that Keystone would carry "dirty" oil, and suggested approval would raise questions abroad about whether the U.S. was serious about climate change.

"Frankly, approving this project would have undercut that global leadership," the president said.

Obama will travel to Paris at the end of the month for talks on a global climate agreement, which the president hopes will be the crowning jewel for his environmental legacy. Killing the pipeline allows Obama to claim aggressive action, strengthening his hand as world leaders gather in France.

Though environmental groups hailed Friday as a "day of celebration," Obama's decision was unlikely to be the last word for Keystone XL.

TransCanada, the company behind the proposal, said it remained "absolutely committed" to building the project and was considering filing a new application for permits. The company has previously raised the possibility of suing the U.S. to recoup the more than $2 billion it says it has already spent on development.

"Today, misplaced symbolism was chosen over merit and science. Rhetoric won out over reason," said TransCanada CEO Russ Girling. His criticism was echoed by Republicans including House Speaker Paul Ryan, who said Obama had rejected tens of thousands of jobs while railroading Congress.

"This decision isn't surprising, but it is sickening," Ryan said.

On the other side, climate activists noted the widespread assumption early in Obama's presidency that he'd eventually approve Keystone, and said his apparent about-face proved how effective a no-holds-barred advocacy campaign could be.

"Now every fossil fuel project around the world is under siege," said Bill McKibben of the environmental group 350.org.

Already, the issue has spilled over into the presidential race. The Republican field is unanimous in support of Keystone, while the Democratic candidates are all opposed — including Hillary Rodham Clinton, who oversaw the early part of the federal review as Obama's first-term secretary of state.

TransCanada first applied for Keystone permits 2,604 days ago in September 2008 — shortly before Obama was elected. As envisioned, Keystone would snake from Canada's tar sands through Montana, South Dakota and Nebraska, then connect with existing pipelines to carry more than 800,000 barrels of crude oil a day to specialized refineries along the Texas Gulf Coast.

But Democrats and environmental groups latched onto Keystone as just the type of project that must be phased out if the world is to seriously combat climate change. Meanwhile, Republicans, Canadian politicians and the energy industry argued the pipeline would create thousands of jobs and inject billions into the economy. They accused Obama of hypocrisy for complaining about a lack of U.S. infrastructure investment while obstructing an $8 billion project.

Amid vote after vote in Congress to try to force Obama's hand, the president seemed content to delay further and further. Most pipelines wait roughly a year and a half for permits to cross the U.S. border, but Keystone's review dragged on more than 5 times as long as average, according to a recent Associated Press analysis.

The first major delay came in 2011, when Obama postponed a decision until after his re-election, citing uncertainty about the proposed route through Nebraska. When Congress passed legislation requiring a decision within 60 days, he rejected the application but allowed TransCanada to re-apply. He delayed again in 2014 — this time indefinitely — in a move that delayed the decision until after the 2014 midterm elections.

Obama conveyed his decision by phone to Canadian Prime Minister Justin Trudeau, sworn in just this week. Trudeau said he was "disappointed by the decision" but pledged to pursue a "fresh start" with Obama nevertheless — a theme Obama echoed as he announced his decision to the American public.

For TransCanada, the financial imperative to build Keystone may have fallen off recently amid a sharp drop in oil prices that could make extracting and transporting the product much less lucrative. TransCanada has insisted that wasn't the case.