The Office for National Statistics (ONS) said the UK’s deficit on trade in goods and services hit £4.5 billion, shrinking from £5.6bn in June.
However, the result came in shy of expectations, with economists having pencilled in a figure of £4.2bn for July.
The brighter picture for UK trade was driven by a jump in exports, lifting £800 million to £43.8bn. The plunge in the value of the pound to 31-year lows following Britain’s vote to leave the European Union has made UK goods more competitive on the global market, helping exports to grow.
The trade gap was also aided by an easing in the total number of imports last month, dropping back by £300m to £48.3bn.
The shrinking of the trade deficit will boost hopes that the economy can continue to grow in the third quarter, despite initial fears that Britain was on course to enter recession.
Howard Archer, chief UK and European economist at IHS Global Insight, said the result adds evidence to the economy’s “current resilience”.
“A major hope for the UK economy going forward is that the substantial overall weakening of the pound since the UK voted to leave the European Union in June’s referendum will increasingly feed through to boost foreign demand for UK goods and services.”
Meanwhile, Britain’s construction industry nudged out a slight recovery in the month following the EU vote, thanks in part to growth in infrastructure output. The ONS said construction output was flat in July, compared with a 1 per cent drop in activity in June.