The Toronto Stock Exchange's S&P/TSX composite index closed up 284.6 points, or 1.41%, at 20,491.01.

Toronto-listed technology stocks jumped 2.15%, tracking gains in the United States' tech-heavy Nasdaq index. The broader index's gains were led by cloud-based software firm Dye & Durham, which surged 22% to its highest close in over six weeks.

"It feels a bit like a relief rally more than anything else," said Greg Taylor, portfolio manager at Purpose Investments. "The bounce we're seeing is really led by some of the most oversold sectors."

Healthcare stocks led the overall index's gains, rising 3.1% with pot producers Canopy Growth, Aurora Cannabis and Cronos Group up between 3.3% and 4.6%.

Basic materials posted the second-biggest gains on the index, adding 2.1%. They followed copper prices, which rose 1.1% as metals consumer China eased pandemic restrictions, stoking hopes for improved demand.

In contrast, gold producers including IAMGOLD Corp and Centerra Gold were among the 10 biggest decliners on the Toronto index, tracking losses in spot gold, which fell on robust U.S. retail sales data and expectations of aggressive interest rate hikes.

The energy sector climbed 1.5% although crude oil, which hit a seven-week high earlier in the session, fell 1.9% , on news that the United States would ease some restrictions on Venezuela's government.

The financials sector gained 1.5%, while the industrials sector rose 2.0%.

The benchmark index last week recorded its seventh consecutive weekly losses, hurt by a recent sell-off in equity markets on concerns around an aggressive policy tightening by central banks to curb inflation.

On the economic front, foreign investors bought a net C$46.94 billion ($36.64 billion) in Canadian securities in March, led by corporate bonds and shares, following a revised C$7.49 billion total purchase in February, Statistics Canada said.

(Reporting by Nichola Saminather in Toronto; editing by Jonathan Oatis)

By Nichola Saminather