The U.S. trade deficit narrowed much more than expected in October, as exports rose a robust 3.2 percent and imports declined slightly in the face of slackening demand for industrial and petroleum products, a Commerce Department report showed on Friday.

The trade gap totaled $38.7 billion, down from a revised estimate of $44.6 billion for September. Analysts surveyed before the report had expected the October trade deficit to narrow just slightly to about $43.60 billion.

The smaller-than-expected deficit could boost estimates of U.S. fourth-quarter economic growth because it implies a larger share of U.S. demand is being met by domestic production.

This suggests that the economy is accelerating, said Neil Dutta, an economist at Bank of America Merrill Lynch in New York, raising his forecast of fourth-quarter economic growth to about 3.0 percent.

But one big reason the trade deficit is shrinking is because we're still in a slower-growth economy. You'd imagine that a smaller number would be a good thing, but it's because people still have to contend with a slower economy, said Robert Pavlik, chief market strategist at Banyan Partners in New York.

U.S. stock index futures held onto their gains after the trade data, while U.S. Treasury bond prices added to losses. The dollar held steady.

On an annual basis, the trade deficit has widened sharply this year and could surpass $500 billion when final figures for 2010 are available. Last year, in the midst of the global financial crisis which put a squeeze on world trade, the U.S. trade gap narrowed about 46 percent to $374.9 billion.

Record exports to China and Mexico in October helped push the overall export tally to $158.7 billion, the highest since August 2008. Exports to the European Union and Japan also showed growth.

Overall U.S. imports fell 0.5 percent to $197.4 billion, led by drop in imports of industrial supplies and materials and the lowest petroleum imports since November 2009.

Despite the overall drop, imports from Mexico were the highest on record and imports from Japan and the European Union were the highest in two years.

Imports of advanced technology products also set a record.

Despite record exports to China in October, the U.S. trade deficit with that country in the first 10 months of 2010 was $226.8 billion, up 20.3 percent from the year-earlier period.

The sharp rise is likely to keep China's trade and currency policies on the minds of U.S. lawmakers in 2011.

China on Friday reported a trade surplus of $22.9 billion in November, as imports and exports were much stronger than expected. Imports rose 37.7 percent from a year earlier and exports jumped 34.9 percent.

Meanwhile, U.S. import prices in November rose at their fastest pace in a year as petroleum and food costs maintained their upward trend, according to a second government report that hinted at a pick-up in imported inflation.

Import prices jumped 1.3 percent, the largest rise since November 2009, after advancing by a revised 1.0 percent in October, the Labor Department said.

(Editing by Andrea Ricci)