China's foreign trade continues to recover from the COVID-19 economic slowing. China said Friday its July trade surplus was $62.33 billion on exports of $237.6 billion and imports of $175.3 billion.

The surplus was 35 percent wider than the country's $46.42 billion surplus in June, according to data from the General Administration of Customs. Economists predicted a $42 billion surplus.

July exports rose 7.2 percent year on year as a result of demand for China's medical products worldwide. Imports fell 1.4 percent over the same period thanks to falling commodity prices and in spite of a total volume increase. Compared with June China's July exports improved 0.5 percent while imports rose 2.7 percent.

China's exports to the U.S., its largest market, rose 12.5 percent to $43.7 billion in spite of a U.S. recession that has slowed economic activity and a trade war with China. Imports of American merchandise rose 3.6 percent to $11.3 billion.

China's exports to the rest of the world improved 3 percent in contrast to many predictions that saw either no growth or small growth only. China exporters earned a lot from a continuing increase in demand for locally made surgical gloves, masks and other medical supplies.

"There is an overall improvement in exports in July from June - not just medical supplies which had previously been the main contributor," ING Group chief economist for greater China Iris Pang said. Gains in shipments of electronics, motor vehicles and clothing in these two months contributed to the result, she said.

Economists polled by Reuters predicted exports to decline 0.2 percent year on year while imports were expected to have risen 1 percent from July 2019. They expect the improvement in foreign trade to continue for the rest of the year.

A lot of the recent resilience in exports has been a result of shipments of face masks, medical products and work-from-home equipment, according to Capital Economics China economist Martin Rasmussen.

Rasmussen said China's recovery would continue because it was sustained by large stimulus spending. Significant government spending will lead to a further rebound in imports, he said.

Foreign demand for China-made goods is likely to continue to recover as countries gradually reopen their COVID-19-hit economies.