The Toronto Stock Exchange's S&P/TSX composite index ended down 11.26 points, or 0.05%, at 22,075.96, after posting on Tuesday a record closing high.
U.S. stocks had a steeper decline as Russian forces bombarded the outskirts of Kyiv and a besieged city in northern Ukraine a day after saying it would scale down operations there in what the West dismissed as a ploy to regroup by invaders suffering heavy losses.
"As we head into the end of the quarter, I think this is a win for the TSX," said Greg Taylor, portfolio manager at Purpose Investments.
"So far what we have seen is a good bounce back in energy stocks and materials which had been responding quite well to some downward pressure in commodities in the last few days and I think this bodes well for the remainder of the year."
The TSX has been one of the few major global benchmarks to gain ground in 2022, advancing 4%. It has been helped by a 27% weighting in resource shares.
The energy group rose 0.6% as the price of oil settled 3.4% higher at $107.82 a barrel, while the materials group, which includes precious and base metals miners and fertilizer companies, added 1.5%. Gold was up 0.7% at about $1,933 per ounce.
Shares of Dollarama Inc gained 3.6% after the discount retailer said it would roll out additional price points up to C$5 this year to shield its margins from heightened inflation.
But the technology sector gave back much of the previous day's advance, falling 2.3%. Heavily-weighted financials ended 0.4% lower.
(Reporting by Fergal Smith; Additional reporting by Amal S in Bengaluru; Editing by Alistair Bell)
By Fergal Smith