(Adds analyst comment, details; updates prices to close)
* TSX ends down 39.30 points, or 0.28 percent, at 14,219.57
* Three decliners for every two gainers
By Alastair Sharp
TORONTO, July 5 (Reuters) - Canada's main stock index fell on Tuesday after four days of gains, as slumping oil prices pulled down energy companies and global jitters weighed while prompting some gains for yield-paying telecom stocks and gold miners.
The Toronto Stock Exchange's S&P/TSX composite index ended down 39.30 points, or 0.28 percent, at 14,219.57. There were three decliners for every two advancers.
The heavyweight energy group retreated 1.6 percent, as renewed worries that Britain's exit from the European Union would slow the global economy pushed oil sharply lower.
"It just ran up so quickly," Ian Nakamoto, director of research at MacDougall, MacDougall & MacTier, said of recent gains for Canadian resource stocks. "I don't think it's anything serious, nor do I think it's a change in direction."
"In general, Canada looks attractive," he added.
Suncor Energy Inc, Canada's largest oil and gas company, fell 1.4 percent to C$36.18, while pipeline operator TransCanada Corp gained 1.8 percent to C$60.01.
Telecom companies gained 1.2 percent overall, with the country's three largest operators among the most influential gainers as investors sought out relatively stable stocks offering decent dividend yields.
Telus Corp gained 1.9 percent to C$42.93, BCE Inc rose 0.9 percent to C$61.73, and Rogers Communications Inc advanced 1.1 percent to C$53.10.
The materials group, which includes precious and base metals miners and fertilizer companies, gained 0.3 percent.
Kinross Gold Corp jumped 5.9 percent to C$7.35 and Franco Nevada Corp gained 2.4 percent to C$101.71, as bullion pushed higher for a fifth straight session, hitting a fresh two-year high.
Barrick Gold Corp, the world's largest gold producer, rose 1.5 percent to C$29.12.
First Quantum Minerals fell 4.7 percent to C$9.41, Teck Resources declined 2.4 percent to C$17.32, and Potash Corp lost 3.3 percent to C$21.09. (Reporting by Alastair Sharp, editing by G Crosse)