China's pile of foreign currency holdings swelled by more than $5 billion last month, according to data from the country's central bank, as the yuan fell to the lowest level in more than a year amid the brewing trade tensions between Washington and Beijing.

The State Administration of Foreign Exchange (SAFE) said foreign currency reserves, which include U.S. dollars, topped $3.118 trillion in the month of July and rose much faster than the $1.51 billion gain record in the previous month. Gold reserves, the SAFE said, dipped by $1.747 billion to $72.324 billion.

"The lack of capital outflows could be (linked to) the recent list of penalties announcement by the cross-border regulator, SAFE, on entities that have breached cross-border fund flows regulations. This might prevent future rules violations, and therefore massive capital outflows," said ING economist Iris Pang. "In fact, foreign direct investments by wholly owned foreign companies could remain the driver of an increase in the foreign exchange reserves for the rest of 2018."

China doesn't break down the composition of its foreign exchange reserves, but most analysts assume that dollars dominate its holdings, given the consistent surplus it records each year from trade with the United States.

The reserve gains suggest President Donald Trump will struggle to tame the country's ongoing surplus, which rose 13.8% to $133.76 billion over the first half of the year, according to China's General Administration of Customs, after hitting a record $28.97 billion in June.

The accumulation of foreign exchange reserves also suggests the People's Bank of China isn't spending U.S. dollars to defend the slumping yuan, which fell some 3% against the greenback over the month of July -- before hitting the lowest level in more than 13 months in August -- as investors exited the currency amid the escalating trade war and persistent signals of slowing economic growth.

The yuan was marked 0.25% higher against the dollar at 6.833 in late Asia trade following moves late last week by the PBOC to add a 20% reserves on short yuan derivatives trades for those betting against the currency.