Canadian energy shares pared earlier losses on Thursday after a ruling by the Federal Court of Appeal against the government's approval of the Trans Mountain pipeline expansion had dragged down the sector.

The move was a major blow to the federal government, which had approved the pipeline's expansion in 2016 and sought to buy the project from the Canadian unit of U.S. construction giant Kinder Morgan for $4.5 billion this year in order to get it built.

During morning trading, energy shares had overtaken material stocks on the S&P/TSX composite index to lead the losses, down more than one per cent at one point.

But the sector pared back losses in the afternoon to close down 0.3 per cent, becoming the fourth biggest drag on the TSX after health care, materials and real estate stocks.

The energy sector has the second-biggest weighting on the benchmark index after the financial sector.

Overall, the Canadian market closed down 0.1 per cent to 16,371.55 points, following its U.S. counterparts as investors worried about global trade.

U.S. stocks took a dive in the afternoon after reports that U.S. President Donald Trump wants to move ahead with a plan to impose tariffs on $200 billion US worth of Chinese imports next week.

In Toronto, shares of Cenovus Energy were among the big energy losers, falling as much as five per cent in the morning, before regaining some of that loss to close down two per cent.

Shares of Canadian Natural Resources also fell 1.2 per cent while shares of energy heavyweight Suncor lifted the market higher, up 0.6 per cent.

Meanwhile, shares of Kinder Morgan Canada closed up 0.5 per cent after shareholders voted more than 99 per cent in favour of selling the Trans Mountain pipeline to the federal government.

News of the company's approval of the sale came shortly after the federal court decision Thursday morning to quash construction approval of the pipeline.