Canada’s TC Energy Corp. TRP 0.59% and the Albertan provincial government said Wednesday they would scuttle the Keystone XL oil pipeline project, bringing to an end a yearslong controversy over an effort to pipe more Canadian crude to the U.S. The decision had been expected after President Biden used his first day in office to revoke a key permit for the pipeline to cross the country’s northern border, shutting down construction.

It marks a historic victory for environmentalists who for a decade have made Keystone XL the focus of a campaign to block new pipeline construction as a way to limit oil consumption that contributes to global warming.

TC Energy gave little explanation for its final decision in a Wednesday news release. It alluded to Mr. Biden’s decision and said it had completed a comprehensive review of its options before making the final decision to terminate the project. It said that going forward it would build its businesses in shipping and storing natural gas, liquid fuels and power to meet growing North American demand for cleaner fuels.

“We value the strong relationships we’ve built through the development of this Project and the experience we’ve gained,” TC Energy Chief Executive François Poirier said.

Environmental groups called TC’s decision a landmark moment and 350.org pointed to its own history of leading sit-ins against Keystone XL in front of the White House. It said it would work to defeat more pipelines.

“When this fight began, people thought Big Oil couldn’t be beat,’’ said Bill McKibben, the founder of 350.org. “But when enough people rise up, we’re stronger even than the richest fossil-fuel companies.”

Mr. Biden’s permit cancellation was a major setback for Canadian oil producers and the Canadian government, which had urged Mr. Biden to help salvage the $8 billion project immediately after his election. Keystone XL has been mired in court challenges and left in limbo by shifting U.S. political leadership since it was initially proposed in 2008.

That was a time of record oil prices, and the pipeline was pitched as a key artery to eventually bring 830,000 barrels a day of Canadian crude from Alberta to Nebraska and then to refineries on the U.S. Gulf Coast. Since then, Canadian oil producers have been rocked by falling oil prices and the government had doubled down on getting approval for the project as a lifeline for the industry.

But Mr. Biden agreed with environmentalists who said opening that avenue for more crude into the U.S. conflicted with a need to respond to climate change by shifting to cleaner sources of energy. He said allowing the project to go ahead would undercut the country’s international credibility as Mr. Biden tried to push other countries to lower their greenhouse-gas emissions.