That helped the resource-rich Toronto Stock Exchange's S&P/TSX composite index <.GSPTSE> outperform U.S. and European indices despite broad and steep losses for most of its main sectors that pushed it down 1.7 percent overall.

It closed down 239.50 points at 13,891.88, but was only marginally lower over the week.

Its junior cousin, the TSX Venture <.SPCDNX> exchange, notched an overall gain due to its heavy weighting in gold producers.

The main index's heavyweight financials group lost 3 percent, with Royal Bank of Canada (>> Royal Bank of Canada) down 3.1 percent at C$77.21 and Manulife Financial Corp (>> Manulife Financial Corp.) slumping 7.4 percent to C$17.35.

"June 23rd probably signals that the best part of this year is over for equity markets, including for Canada," said Elvis Picardo, strategist at Global Securities in Vancouver, referring to the date of the British EU referendum.

The blow to investor confidence and the uncertainty unleashed by the Brexit vote could keep the U.S. Federal Reserve from raising interest rates as planned this year, and even spark a new round of emergency policy easing from major central banks.

Oil prices plunged, taking Canadian energy stocks down more than 3 percent. [O/R]

But gold miners surged, accounting for 12 of the index's 15 most influential gains, as investors piled into bullion, considered a lower risk asset to hold in uncertain times.

Barrick Gold Corp (>> Barrick Gold Corp.), the world's largest gold producer, jumped 7.9 percent to C$26.65 and Goldcorp Inc (>> Goldcorp Inc.), another major producer, advanced 6.4 percent to C$23.89.

The TSX's materials group, which includes precious and base metals miners and fertilizer companies, added 3.2 percent. Utilities recorded a 0.4 percent gain.

Investors also sought to look past the kneejerk reaction to the British vote, arguing that Canada's exposure is limited.

"If we get through the next couple of days without major collateral damage or contagion, then I think there will be some opportunities surfacing," said Tom Caldwell, chairman of broker and wealth manager Caldwell Securities.

Stephen Carlin, head of equities and portfolio manager at CIBC Asset Management, said gold's upside from here was likely limited but that he likes high-yielding pipeline, telecom, utility and real estate stocks given the prospect of easier monetary policy globally.

(Additional reporting by Matt Scuffham; editing by Alan Crosby and David Gregorio)

By Alastair Sharp