The General Administration of Customs said in an online statement that China posted a trade deficit of $1.02 billion from January to March this year..
However, China reported a small trade surplus of $140 million in March, up from a deficit of $7.3 billion the month before, it said.
Export growth in the first quarter was strong, it said, increasing 26.5 percent to $399.64 billion compared to a year earlier, but imports soared 32.6 percent during that period, to $400.66 billion.
"The value of imports in the first quarter hit a record high for the first time of more than $400 billion," the administration said.
It said China imported more mechanical and electrical equipment, including cars, as well as iron ore and soybeans, than it did a year ago and that the prices of those commodities had all shot up.
Analysts expect a Chinese global trade surplus this year of $160 billion-$200 billion but say that should narrow if oil and commodity prices stay high. Last year, China ran a trade surplus of about $16 billion a month.
A smaller trade surplus might help to ease trade strains with Washington and other governments that complain Beijing is giving its exporters an unfair advantage with currency controls and other policies.
Stronger imports could help economies looking to China's robust growth to drive demand for their goods. Imports also might benefit from ongoing government efforts to boost consumer spending to reduce reliance on exports and investment.
China is a major importer of oil, iron ore and raw materials and runs a deficit with suppliers such as Saudi Arabia and Australia. It pays for that by running multibillion-dollar surpluses with the United States and Europe.