TORONTO -- The Toronto stock market closed lower Friday as disappointing economic data from China punished commodity prices and resource stocks.

The S&P/TSX composite index was off the worst levels of the session in the wake of better than expected U.S. consumer sentiment and manufacturing data.

The index fell 48.71 points to 12,773.12 while the TSX Venture Exchange was down 13.27 points to 1,120.09.

The Canadian dollar was up 0.4 of a cent to 97.36 cents US as Statistics Canada reported that gross domestic product grew at an annualized rate of 0.6 per cent in the fourth quarter, which matched expectations. However, GDP actually shrank in the final month of the year, dropping 0.2 per cent, which was also in line with economists' forecasts.

The Institute for Supply Management's February reading on the manufacturing sector showed stronger than expected expansion, rising to 54.2 from 53.1 in January.

And the University of Michigan's widely watched consumer sentiment index rose to 77.3.

The Dow Jones industrials came back from a triple-digit tumble to gain 35.17 points to 14,089.66, the Nasdaq was ahead 9.55 points to 3,169.74 and the S&P 500 index was up 3.52 points to 1,518.2.

In other economic news, the U.S. Commerce Department said Friday that consumer spending rose 0.2 per cent in January, driven by an increase in spending on services, partly reflecting higher heating bills. Spending on durable goods, such as cars and appliances, fell 0.8 per cent.

Income fell 3.6 per cent in January, the biggest drop since January 1993. But it followed a hefty 2.6 per cent rise in December which reflected a rush by companies to pay dividends and bonuses before income taxes increased on top earners.

Traders also considered the effect of deep U.S. government spending cuts due to take effect Friday. It's known as the sequester and involves US$85 billion of across-the-board cuts.

After meeting with congressional leaders during the morning, President Barack Obama blamed Republican lawmakers for failing to stop the automatic spending cuts. Republicans said the fault was his, for insisting that increased taxes be part of the resolution.

Also in the background was the uncertainty surrounding Europe's third-biggest economy following inconclusive elections earlier this week.

"The Italian election results set the week off on a soft tone and then the inability of the Congress and the president to come up with a more surgical solution to the sequester disappoints people, but also points to the dysfunction of the U.S. political process," said Norman Raschkowan, North American strategist at Mackenzie Financial Corp.

"And I think it's not necessarily a long-term issue because I think they will come up with something. But I think it is just another element of uncertainty that people don't need."

There was big news on the proposed Keystone XL pipeline just before the close.

The U.S. State Department says TransCanada's Keystone XL pipeline won't have a significant impact on Alberta's oilsands development, a finding that might make it easier for the White House to approve the controversial project.

The report's findings represent the clearing of a significant hurdle for Calgary-based TransCanada (TSX:TRP) in its marathon bid to win approval for Keystone XL from the Obama administration. TransCanada shares were already in the red before the announcement, losing 23 cents to $47.81.

Prices for oil and copper registered sharp declines as government data showed that Chinese manufacturing activity expanded at a slower rate in February than January.

The government-sponsored version of the manufacturing Purchasing Managers' Index came in at 50.1 for February, only marginally ahead of the 50-point threshold that signals an expansion. Economists had looked for a reading of 50.5.

The gold sector led decliners, down about 1.4 per cent while April gold fell $5.80 to US$1,572.30 an ounce.

The base metals sector was also a major decliner, down about 1.1 per cenet while May copper on the Nymex fell five cents to US$3.50 a pound. China is the biggest consumer of the metal.

The energy sector was down about 0.4 per cent as the April crude contract on the New York Mercantile Exchange fell $1.37 to $90.68 a barrel.

The consumer discretionary segment led advancers as shares in automaker Magna International (TSX:MG) rose $2.17 to $57.02 after it reported stronger than expected fourth-quarter results, raised its production outlook for 2013 and announced a dividend increase.

The TSX finished up 0.56 per cent on the week while the Dow industrials rose 0.63 per cent.

In other earnings news, after the close Thursday, National Bank of Canada (TSX:NA) reported adjusted net income of $2.02 per diluted share for the first quarter of fiscal 2013, beating analyst estimates by a penny. Total revenue for the quarter, however, was $1.24 billion, mostly flat compared to the year earlier period and below analyst expectations of $1.29 billion. Its shares dropped 61 cents to $77.95.

And toymaker Mega Brands Inc. (TSX:MB) posted quarterly earnings of US$4 million, up from $200,000 a year earlier while sales jumped 18 per cent to US$127.5 million.

There is relatively little analyst coverage of Mega Brands but it appears the company's sales were better than expected and profit missed the mark. But its shares gained 68 cents to $12.47.