OTTAWA — A Canadian court on Thursday froze plans to expand an oil pipeline that the government is about to purchase, ruling that the government’s National Energy Board had not adequately consulted with Indigenous people along the pipeline’s route or assessed the project’s potential effects on the waters off British Columbia.

While the practical effect of the decision may be a comparatively short construction delay, the ruling added fuel to an already incendiary debate over the Trans Mountain pipeline that links Alberta’s oil sands to an oil tanker port near Vancouver, British Columbia. The pipeline also branches off to refineries in Washington State.

After the pipeline’s owner, Kinder Morgan of Houston, abandoned its plans to add a second pipeline along the existing Trans Mountain route in April, Prime Minister Justin Trudeau’s government stepped in to buy the 715-mile pipeline for 4.5 billion Canadian dollars, or about $3.4 billion. The sale is expected to be completed soon, possibly this week.

Environmentalists and some Indigenous groups immediately called the ruling a major victory, and some of them urged Mr. Trudeau’s government to give up on plans for the expansion, which has drawn widespread protests driven by environmental concerns.