Mr. Trudeau acknowledged the dissent.

“There are people who will not be convinced by the arguments we put forward and we accept that,” he said.

At the same time, Mr. Trudeau is unlikely to get credit from the pipeline’s proponents in Alberta.

“He’s really in a tough spot,” said Lori Turnbull, a professor of political science at Dalhousie University in Halifax, Nova Scotia, before the official announcement. “Trudeau can’t claim a victory out of this no matter what he does.”

[Want more Canada coverage in your inbox? Sign up for the Canada Letter newsletter.]

The government will put profits it earns from the operation of the pipeline, as well its eventual sale, back into alternative energy programs, Mr. Trudeau said, adding that the government is open to selling stakes in the project to Indigenous groups.

Alberta’s landlocked oil industry has been repeatedly thwarted in its quest for additional pipelines. At the news conference, Mr. Trudeau noted that after a decade, the previous Conservative government “built exactly zero pipelines to new markets, but they did manage to build one thing: extreme animosity between those who want pipelines, and those who don’t.”

The Keystone XL project that would link Alberta’s oil sands to the Gulf Coast of the United States has faced strong opposition from environmentalists and some landowners, leaving it mired in litigation. A pipeline to Eastern Canada was abandoned by its proponents, and Mr. Trudeau did not approve a new pipeline that would have run through Northern British Columbia after resistance from Indigenous groups; its route had also effectively caused its proponents to abandon it.

Squeezed for capacity, the oil industry has increasingly turned to trains to ship its products from the oil sands, a method that is both costly and potentially dangerous because of the risk of derailments. The industry in Alberta also argues that it is forced to sell its product at a discount because of the transportation issues.