China posted its first monthly trade deficit in three years in February as imports surged at their fastest pace since early 2012.

The growth of imports was driven by the country's strong demand for commodities from iron ore to crude oil and coal. 

China's February exports unexpectedly fell 1.3% from a year earlier, but imports expanded 38.1%, well above economists' forecasts, customs data showed today. 

That left the country with a trade deficit of $9.15 billion for the month, the General Administration of Customs said. 

But China watchers have cautioned that trends in January and February can be distorted by the long Lunar New Year holidays, with business slowing down weeks ahead of time and many firms scaling back operations or closing. 

The holiday began in late January this year and in February last year. 

China's exports for January and February combined rose 4% from the same time last year, while imports surged 26.4%.

This suggested there has been solid improvement in demand at home and abroad despite any holiday distortions. 

Analysts polled by Reuters had expected February exports from the world's largest exporter to have risen 12.3%, an improvement from a 7.9% rise in January. 

Imports had been expected to rise 20%, after growing 16.7% in January. 

Analysts had expected China's trade surplus to fall to $25.75 billion in February compared to January's $51.35 billion, with growing attention on its large trade advantage with the US as new President Donald Trump ramps up his protectionist rhetoric.