(Adds portfolio manager quotes, details on performance and utilities group, updates prices)
* TSX ends up 27.8 points, or 0.2 percent, at 14,064.54
* Eight of the TSX's 10 main groups end lower
* Index gains 1.2 in short week; near flat for June
* Index rises 4.2 percent in the second quarter
By Fergal Smith
TORONTO, June 30 (Reuters) - Canada's main stock index closed higher on Thursday as a rally in gold stocks offset losses for financial sector stocks and lift the market for a third straight session.
The index was nearly unchanged for the month of June, but rose 1.2 percent on the week and 4.2 percent for the second quarter. Its heavy concentration of gold miners helped limit a selloff in the wake of Britain's vote to leave the European Union last week. The market will be closed on Friday for a national holiday.
"The precious metal stocks are going, I think, to be fairly strong through the summer," said James Winckler, research associate at MacNicol and Associates Asset Management, who expects them to benefit from a "flight to safety."
The materials group, which includes precious and base metals miners and fertilizer companies, climbed 1.1 percent.
Barrick Gold Corp advanced 2.4 percent to C$27.58 and Goldcorp Inc gained 1.4 percent to C$24.72.
Investors pushed the price of bullion to a two-year high after the Brexit vote. Spot gold rose 0.3 percent.
Industrial stocks rose 0.4 percent as railway stocks climbed, while the interest-rate sensitive utilities group advanced 0.8 percent.
Gains for utilities came as Canada's 30-year bond yield hit a new record low at 1.706 percent and after Bank of England Governor Mark Carney said the central bank would probably need to pump more stimulus into Britain's economy over the summer.
"What's driving stocks in general for pretty much all countries is a low interest rate environment," Winckler said.
The Toronto Stock Exchange's S&P/TSX composite index closed up 27.8 points, or 0.2 percent, at 14,064.54. It touched its highest since June 23 at 14,106.79.
Eight of the index's 10 main groups ended higher.
Superior Plus Corp rose 3.7 percent to C$10.66 after terminating a deal to buy Canexus Corp, which dropped 0.8 percent to C$1.27.
The energy group ended 0.1 percent higher, restrained by losses for crude oil. U.S. crude oil futures settled $1.55 lower at $48.33 a barrel.
Canadian Imperial Bank of Commerce, which on Wednesday said it was buying a U.S. bank, fell 0.9 percent to C$97.04, while the overall financials group dipped 0.3 percent.
The Canadian economy grew 0.1 percent in April from March, paving the way for a sickly second quarter on the back of devastation caused by wildfires in Alberta. (Reporting by Alastair Sharp; Editing by James Dalgleish and Alan Crosby)