The value of German exports jumped by 4.5% in June to hit a record level, though economists cautioned that much of the increase was likely due to soaring prices.
Exports rose for a third month in a row, beating forecasts for a 1% increase and pushing Germany's seasonally adjusted trade surplus to €6.4 billion in June, well above consensus for a €2.7 billion surplus.
Preliminary data last month had shown Germany posting its first trade deficit in more than 30 years, but the May figure of - €1.0 billion was revised to a surplus of €0.8 billion.
"These figures should be taken with a grain of salt," Thomas Gitzel of VP Bank said, saying that price increases could increase nominal export volumes without more goods actually having been exported.
"Adjusted for prices, little is likely to remain of the export growth."
The German economy stagnated in the second quarter, with the war in Ukraine, the pandemic and supply disruptions bringing Europe's largest economy to the edge of a downturn.
The Association of German Chambers of Industry and Commerce (DIHK) warned that Germany's export-reliant industry faced a difficult second half of the year.
"Supply chain disruptions and high costs for energy, raw materials and imported inputs continue to hamper production," said DIHK foreign trade expert Carolin Herweg.
"Also, the cooling of the economies of important export partners, such as the United States, China or the euro zone, is also dampening demand for products 'Made in Germany'."
Exports to the United States, Germany's biggest exports market, rose by 6.2% in June compared with May, while those to European Union member states were up by 3.9%.
Exports to China edged up by 2.4% in June.
June imports to Germany increased by 0.2% on the previous month in calendar - and seasonally-adjusted terms, the federal statistics office said.
Analysts polled by Reuters had pointed to a month-on-month increase of 1.3%.