By Jennifer Kwan

TORONTO (Reuters) - Toronto's main stock index
ended lower Tuesday but trimmed losses after the U.S.
Federal Reserve said it would reinvest maturing mortgage debt
in government bonds to support economic recovery.

The resource-heavy Canadian index, which early in the day
fell more than 100 points on soft economic data from the United
States and China, rallied into positive territory briefly after
the Fed move.

"The Fed is engaging in further monetary accommodation,
which is supportive of the markets," said Fergal Smith,
managing market strategist at Action Economics.

Serge Pepin, head of investments at BMO Investments Inc,
said there had been "anxiety as to was the Fed prepared to
revive the quantitative easing".

"The fact that it didn't, the fact that it is still sort of
holding off to see if there's anything way more negative in the
economy, gave optimism to investors ... that the recovery is
still on track; perhaps that the slowdown and the economic
recovery is not as dire as perhaps anticipated," he said.

Also cushioning the TSX's fall was strength in the price of
gold, which helped boost Barrick Gold by 1 percent to
C$44.93, and fellow gold miner Agnico-Eagle by 1.8
percent to C$62.85.

The Toronto Stock Exchange's S&P/TSX composite index
finished the day down 25.27 points, or 0.21 percent,
at 11,838.29, with eight of its 10 sectors lower.

The blue chip S&P/TSX 60 index closed 0.7 of a
point, or 0.1 percent, lower at 692.15.

Declining stocks included Royal Bank of Canada,
down 0.2 percent at C$53.35; Canadian Natural Resources, down 2
percent at C$36.13; and Teck Resources , which fell
0.7 percent to C$36.06.

The index's three key sectors -- energy, financial and
materials -- fell as data showed U.S. business productivity
fell for the first time in 1-1/2 years in the second quarter,
underlining the soft recovery.

As well, China reported much slower than expected growth in
July imports, signaling slowing domestic demand.

In Canada, data showed housing starts fell in July for a
third straight month and new home prices rose less than
expected in June, suggesting that the housing boom is stalled.

"All of that is still leaving a dark cloud over the
market," Pepin said.

In individual company news, BlackBerry maker Research In
Motion, up 1.7 percent at C$57.79, has agreed to hand
over some coveted codes to users' phones to try to avert a ban
on its Messenger service in Saudi Arabia, an industry source
familiar with the talks told Reuters on Tuesday.

Shares of Maple Leaf Foods rallied 4.9 percent to
C$9.44 after the Ontario Teachers' Pension Plan, the company's
largest stakeholder, said it was selling about 11 percent but
will hold on to its remaining stake for now.

($1=$1.03 Canadian)
(Reporting by Jennifer Kwan; editing by Peter Galloway)