President Obama has rejected the Keystone XL pipeline, killing the long-stalled project to bring oil from the Canadian tar sands to Texas.

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

The announcement, during which the president was flanked by John Kerry, his secretary of state, and Vice President Joe Biden, is the culmination of years of debate—much of it rancorous—over the Canadian company TransCanada’s proposed 1,661-mile pipeline. On Thursday, the State Department rejected TransCanada’s request to put a review of the project on hold until a dispute in Nebraska over the project’s proposed route was resolved.

The State Department, which had final say because the project crossed an international border, had been reviewing the pipeline for more than six years, working to determine whether it was in the national interest. Congressional Republicans had tried—unsuccessfully—this year to circumvent that process and grant the project a permit immediately. Friday’s decision effectively kills all those efforts.

Environmentalists, some landowners in Nebraska, and liberal Democrats had long opposed the project, arguing the negative environmental impact outweighed any positive contribution. But supporters of the project—including politicians from both parties, some unions, and energy companies—said the pipeline would create jobs and reduce U.S. dependence of oil from the Middle East. (You can read about the debate here.) Both those arguments have been eroded since the project was first proposed: The price of oil is at multi-year lows amid a supply glut, and the U.S. is now one of its top producers. Add to those factors Friday’s jobs numbers: The Bureau of Labor Statistics reported the U.S. added 271,000 jobs last month —far higher than 180,000 figure estimated by economists. The unemployment rate held steady at 5 percent.

Obama’s announcement is likely to have an impact on the presidential race. Hillary Clinton, the Democratic front-runner, had already come out against it, as has her main rival, Bernie Sanders. The Republican candidates support the project.