* TSX ends up 0.1% at 20,027.35

* Energy rises 0.8%; oil settles 3.4% higher

* Financials advance 0.4%

* Utilities end 0.8% lower

June 15 (Reuters) - Canada's main stock index edged higher on Thursday as a rally in oil prices boosted energy shares, but the market's advance was much less than on Wall Street, adding to its underperformance this year.

The Toronto Stock Exchange's S&P/TSX composite index ended up 12.26 points, or 0.1%, at 20,027.35, its fourth straight day of gains.

"Today's market action is a perfect example that the TSX is being left behind by this massive rally in the U.S. that is largely being fueled by the AI-related stocks," said Elvis Picardo, portfolio manager at Luft Financial, iA Private Wealth.

"I would certainly like to see the market breadth broaden out a little bit."

Wall Street rallied as economic data fueled bets that the Federal Reserve is nearing the end of its aggressive interest-rate hike campaign.

U.S. benchmark the S&P 500 rose 1.2%, and it has advanced 15.3% since the beginning of the year compared to a gain of 3.3% for the TSX.

Still, foreign investors on the Toronto market benefited on Thursday by gains for the

Canadian dollar

. It climbed 0.8% to trade at a nine-month high.

The TSX's energy sector rose 0.8% on Thursday as oil settled 3.4% higher at $70.62 a barrel after data showed a jump in refinery runs in top crude importer China.

Heavily-weighted financials also gained ground, rising 0.4%, while shares of First Quantum Minerals Ltd climbed 7.6% after a report saying the copper miner rejected an informal takeover offer from Barrick Gold Corp.

In contrast, utilities lost 0.8% and real estate ended 0.5% lower. The decline for real estate came as domestic data showed housing starts tumbling 23% in May compared with the previous month. (Reporting by Fergal Smith in Toronto and Ankika Biswas in Bengaluru; Editing by Shweta Agarwal, Grant McCool and David Gregorio)