China swung back to a trade surplus last month, reversing a massive deficit recorded in February, the official Xinhua news agency said today.

The country recorded a surplus of $5.35 billion in March, as exports rose 8.9% to $165.66 billion for the month.

Imports were $160.31 billion in March, Xinhua said, but gave no growth figure. 

In February, China registered a huge trade deficit of $31.48 billion as the West's economic troubles hit the world's second largest economy.

The February deficit was the largest in over a decade

Analysts had predicted a deficit of $3.2 billion for March, according to a median forecast of 15 economists. The latest figures could provide hope that China will avoid a hard landing despite slowing exports, a major engine of growth for the economy.

China's economy is widely expected to slow this year as woes in key export markets such as Europe and the US hit its overseas sales. The government last month set a target for 7.5% economic growth this year. China's economy grew 9.2% last year and 10.4% in 2010.