China's exports hit a record high in July as shipments to Europe and the United States proved surprisingly buoyant, allaying concerns that debt problems abroad may hold back the world's No. 2 economy.

But analysts warned it was too soon to declare that Chinese exports can hold up in coming months as debt worries, sluggish consumer spending and now wildly volatile financial markets plague its two biggest customers.

Both imports and exports are likely to grow at a slower pace in coming months, said Li Xunlei, an economist at Guotai Junan Securities in Shanghai. The global financial market turbulence may lead to a contraction in external demand.

July exports rose 20.4 percent from a year ago, the strongest gain since April and surpassing economists' median forecast for a 17.4 percent rise, data on Wednesday showed.

Imports were roughly in line with expectations, rising 22.9 percent in July from a year earlier, the General Administration of Customs said. Economists had forecast growth of 22.3 percent.

China's trade sector is still facing great uncertainties, said Nie Wen, an analyst at Hwabao Trust in Shanghai. Developed countries are forced to take austerity measures, and emerging markets may tighten (policy) as well to tame inflation.

Indeed, just hours earlier, the U.S. Federal Reserve took the unprecedented step of promising to leave interest rates near zero for at least two more years, painting a gloomy picture for the world's largest economy.

Noting that monetary policy risks are shifting to supporting growth from fighting inflation, China has signaled it may pause its 10-month policy tightening campaign for now.

Wednesday's data suggested sluggishness in the U.S. and European economies has yet to put a big dent in Chinese export growth, as many investors had feared. Instead, robust U.S. and European shipments helped pushed the value of China's monthly exports to a record high of $175.1 billion.

Although annual growth in Chinese exports to the United States in July was marginally weaker than June at 9.5 percent, the total value hit the year's high of $30 billion.

Annual growth of exports to Europe nearly doubled to 22.3 percent, lifting the value of sales to $35.1 billion. Export growth to Japan also picked up sharply.

BHP Billiton , the world's biggest miner, said on Wednesday it expected weak growth in Europe and the United States to persist for many years as they deal with their debt crises, heightening the reliance on China's fast-growing economy.

PRESSURE ON YUAN TO RISE

Other data this week showed that China's inflation hit three-year highs of 6.5 percent in July, and some officials have said that it has likely peaked.

But underlining the fine balance that Beijing has to tread between managing growth and inflation, July's brisk exports caused China's trade surplus to balloon to $31.5 billion, its widest since January 2009.

That could fuel price pressures at home and more criticism from its trade partners abroad that Beijing is keeping its yuan currency suppressed to sell more exports at their expense, allegations China has always denied.

As part of Beijing's policy to prevent the yuan from rising too quickly, it buys dollars earned from trade revenues. But Beijing injects more than 6 yuan into China's banking system for every dollar it buys, adding to a surfeit of cash that fans inflation.

So even if Beijing is reluctant to tighten policy now, it may need to step aside nonetheless to let the yuan climb more briskly if it wants to keep a lid on prices, analysts said.

China's monetary policy has been kidnapped by foreign capital inflows, said Zhang Lei, an analyst at Minsheng Securities in Shanghai, referring to the widening trade surplus.

Yuan appreciation is still one important option.

CHINA IS OK

To be sure, all signs suggest that China's economy has taken the steady policy tightening in the past year well in its stride, with its red-hot growth moderating only slightly so far.

Most market watchers continue to predict a soft economic landing, with growth easing to 8-9 percent, rather than a sharp decline.

Many economists agreed that the latest trade data showed China's growth engine is whirring along, with domestic demand solid.

Retail sales climbed 17.2 percent in July from a year earlier, albeit not quite as much as analysts had expected, while car sales rose 6.7 percent, picking up momentum from the previous month.

Imports of raw materials such as copper and iron ore saw strong gains from June, and the recent plunge in global commodity prices is likely to stoke more Chinese buying.

That should comfort investors looking to China to pick up some slack in global demand as other major economies sputter.

And China's relatively low -- albeit rising -- production costs could keep its exports competitive when times are rough, analysts said.

In the past couple of months, the U.S. economy has been turning down, but China's export growth has held out, said Bank of America-Merrill Lynch's Lu.

This shows China's economy is okay.

Beijing, which has repeatedly voiced confidence in China's growth in the past year, reiterated the line this week, though it has been clearly rattled by heavy selling in financial markets after the United States lost its top-rated credit rating on Friday.

Premier Wen Jiabao said on Tuesday that China's economy continues to show good growth momentum. But in a sign Beijing would rather err on the side of caution, he signaled China may soften its strike against inflation.

An official Chinese newspaper also said as much on Wednesday by declaring in a front-page editorial that Beijing would refrain from raising interest rates for now due to the rout in global markets.

However, China top economic planner stressed that inflation dangers remained, including the possibility of a new round of monetary easing in the United States which could fuel fresh price pressures.

(Reporting by Beijing economics team; Editing by Ken Wills & Kim Coghill)