WASHINGTON — President Barack Obama on Friday rejected TransCanada’s application to build the Keystone XL pipeline, which would have transported oil across the United States-Canada border.

After seven years of reviewing the project, Obama announced his decision — ending one of the biggest environmental question marks of his presidency — from the Roosevelt Room in the White House.

“The State Department has decided that the Keystone XL pipeline would not serve the national interest of the United States,” he said. “I agree with that decision.”

Tensions over the proposed pipeline had been high for years, with Obama’s environmental base pressuring him to reject the project — citing its impact on emissions — and Republicans inCongress voting repeatedly to force its approval, citing the economic boost it would provide.