(Adds investor comments, details; updates prices to close)
* TSX ends down 239.50 points, or 1.7 percent, at 13,891.88
* Index notches marginally loss over week
* Eight of the TSX's 10 main groups down
* Material group up 3.2 pct as gold miners surge
By Alastair Sharp
TORONTO, June 24 (Reuters) - Canada's main stock index fell on Friday the most in four months, as financial and energy stocks slid after Britain voted to leave the European Union, while the resulting market turmoil boosted gold miners as demand for the precious metal surged.
That helped the resource-rich Toronto Stock Exchange's S&P/TSX composite index 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 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 down 3.1 percent at C$77.21 and 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.
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, the world's largest gold producer, jumped 7.9 percent to C$26.65 and 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)