WASHINGTON - The Obama administration has rejected Canadian energy giant TransCanada's application to build the Keystone XL pipeline.

That's according to three sources familiar with the decision who aren't authorized to comment publicly and spoke on condition of anonymity.

The decision caps a 7-year saga that became one of the biggest environmental flashpoints of Barack Obama's presidency.

Killing the pipeline allows Obama to claim aggressive action on the environment. That could strengthen his hand as world leaders prepare to finalize major global climate pact next month that Obama hopes will be a crowning jewel for his legacy.

Yet it also puts the president in a direct confrontation with Republicans and energy advocates that will almost surely spill over into the 2016 presidential election.