Germany exported goods at a record pace in 2017 thanks to the acceleration in global growth, while imports into the eurozone's biggest economy also hit an all-time high as domestic demand increased.
Exports rose 6.3% to €1,279bn in 2017, while imports rose by 8.3% to €1,034bn - both higher than the previous record highs recorded in 2016, said Destatis, Germany's federal statistics office.
The gave a foreign trade surplus of €244.9bn in 2017, just shy of 2016's all-time high of €248.9bn.
Exports to fellow member states of the European Union increased 6.3% to €750bn, while it imported goods to the value of €682.5bn, up 7.9% on 2016.
Goods exported to countries outside of the EU totalled €529.4bn, up 6.3% on 2016, while imports rose 9.1% to €352.1bn.
The export data underlined the strength of the eurozone's most powerful economy, while the import figures suggested that Germany's economy was also built on robust domestic demand.
German stocks were broadly lower as equity markets continued a volatile run. The euro, meanwhile, fell 0.15% against the dollar to $1.2243, and shed 0.1% versus the pound to £0.8830.