The Toronto Stock Exchange's S&P/TSX composite index ended up 5.71 points, or 0.03%, at 21,937.89. On Tuesday, it notched a record closing high of 22,074.35.

The healthcare sector, which includes cannabis producers, rose 6.8% after news that the U.S. House of Representatives is preparing to vote on federal legalization of marijuana.

Energy shares were a drag, falling 0.2%, as the price of oil settled 2.25% lower at $112.34 a barrel.

"Crude prices are declining as energy traders expect that after all the EU leader, NATO, and G7 meetings, Russian energy will not be sanctioned anytime soon," Edward Moya, a senior market analyst at OANDA, said in a note.

European Union leaders are set to agree at a two-day summit starting on Thursday to jointly buy gas as they seek to cut reliance on Russian fuels, with some saying they would not comply with Moscow's demand to buy oil and gas using roubles.

The energy and materials sectors combined account for 27% of the weighting on the Toronto market.

Among individual shares, Brookfield Asset Management Inc rose 1.25% after a unit of the company and fund manager Morrison & Co entered an exclusivity deed with Uniti Group.

Meanwhile, economists said that Canadian Prime Minister Justin Trudeau's surprise political deal with the smaller left-leaning New Democrats will lead to heftier deficits and threatens to upend the Liberal government's promise to rein in runaway inflation.

(Reporting by Fergal Smith in Toronto; Additional reporting by Amal S in Bengaluru; Editing by Matthew Lewis)

By Fergal Smith