China posted its biggest-ever monthly trade surplus in July, as government stimulus measures to stop the economy slowing down generated a big rebound in the country’s exports.

The General Customs Administration said exports rose 15% on the year, double what was forecast by a Reuters survey, with shipments to all of China’s major trading partners–the U.S., E.U., Japan and South-East Asia–clearly up.

Imports, by contrast, fell 1.6% on the year, missing forecasts of a 3% increase, reflecting in part lower prices for the commodities that fuel its economy. Over the first seven months of the year, China has imported 18% more iron ore for steelmaking, but the average price for it has fallen 15%. Likewise coal imports fell 2.2% by volume, at an average price down 15% from a year ago. Analysts said that an ongoing probe into commodity-backed loan deals also probably depressed import volumes.

As a result, China’s trade surplus hit $47.3 billion in July, up from $31.6 billion in June. Economist had forecast a slight narrowing to $28 billion.

The figures are the latest to suggest that the government succeeded in stopping a slowdown caused reversing–at least temporarily–its declared strategy of rebalancing the economy, downgrading exports and focusing more on domestic consumption. Those policies had pushed the yuan lower against the dollar, reviving fears about manipulation of the exchange rate to steal a competitive advantage in international markets. However, as the economic data have improved over the last two months, the yuan has risen by 2% against the greenback.

In the land of the world’s other big trade surplus, Germany reported a more modest 1.1% increase in exports on the month in June, leaving them up 2.1% on the year and up 2.4% for the first of the year as a whole. The current account surplus for the first half edged up to €93.5 billion from €92.4 billion a year earlier.

As with China, Germany’s current account is a source of frustration in Washington, which sees their huge and chronic surpluses as major imbalances in the world economy. In contrast to China, Germany has no direct control over its exchange rate, but it has still benefited in the past from sharing a currency, the euro, with other countries whose current accounts are much weaker, which reduces the upward pressure on it.

Germany came under fire during the euro crisis for failing to do enough to support other Eurozone economies by buying their goods, but its trade with the rest of the Eurozone is now roughly in balance. In the first half of this year, it shipped €208.6 billion in exports to Eurozone countries, and imported €2o7.3 billion. Out of a trade surplus of €106.2 billion in the first half, around three quarters of that was with countries outside the E.U., while the rest was with countries such as the U.K. and Poland, which are E.U, member but which don’t use the euro.

An earlier version of this story incorrectly stated the reporting month for the Chinese data. The article has been corrected to reflect this.