* TSX falls 102.15 points, or 0.78 percent, to 12,945.63
* Index's materials, financials, energy sectors all lower
* Weak Canadian and U.S. economic data weigh
* Drop in oil prices also helps to pull index lower (Updates to close, adds analyst's comment)
TORONTO, July 29 (Reuters) - Toronto's main stock index closed sharply lower on Friday, though off the one-month low it hit earlier in the day, as weak economic data and the U.S. debt crisis pushed investors to the safety of the sidelines.
The index's materials sector had the biggest drop, down 1.28 percent, followed by the financials group, which fell 0.93 percent.
Royal Bank of Canada (RY.TO) was the top heavyweight decliner, down 1.3 percent at C$51.4. Next came fertilizer producer Potash Corp (POT.TO), down 1.9 percent at C$55.16, and miner Goldcorp (G.TO), which dropped 2.2 percent to C$45.69.
With most Canadian markets closed on Monday for various provincial holidays, anxious investors moved to sidelines in advance of Tuesday's deadline for the United States to raise its debt ceiling.
U.S. President Barack Obama told deeply divided Republicans and Democrats on Friday to stop bickering and find a way "out of this mess". [ID:nN1E76S004]
"The Aug. 2 debt ceiling deadline is weighing," said John Kinsey, portfolio manager at Caldwell Securities. "You don't want to be short in case something good - or bad - happens over the weekend."
Weak economic data also weighed on equities. Canada's economy unexpectedly shrank in May, with gross domestic product falling 0.3 percent from a month earlier. It was the largest drop since a matching decrease in May 2009. [N1E76S093]
South of the border, GDP data showed the U.S. economy stumbled badly in the first half of this year and came dangerously close to contracting in the January-March period. [nCAT005481]
Adding to investor anxiety, rating agency Moody's placed Spain's Aa2 credit rating on review for possible downgrade, reviving fears of contagion in the euro zone debt crisis.
The Toronto Stock Exchange's S&P/TSX composite index .GSPTSE ended the session down 102.15 points, or 0.78 percent, at 12,945.63, after falling to its lowest level since June 27 earlier in the session. Eight of the 10 main index sectors were lower on Friday.
The index was down 4.1 percent for the week, and 2.7 percent for July.
Helping to offset losses, Bombardier (BBDb.TO) was up 2.12 percent to C$5.78 after Korean Air said on Thursday it would purchase 10 CS300 aircraft from the Canadian plane and train maker for $675 million.
Fairfax Financial (FFH.TO) rose 1.6 percent to C$376.00. Fairfax reported a higher quarterly profit late on Thursday. [nN1E76Q249]
Maple Leaf Foods (MFI.TO) was up 4.5 percent at C$11.49. On Thursday the Canadian food processor said it had adopted a shareholder rights plan and that its chief executive would acquire nearly a third of its shares, prompting speculation a takeover attempt could be in the works. [nS6E7IC008]
($1=$0.95 Canadian) (Reporting by Trish Nixon; editing by Peter Galloway)