Britain’s yawning trade gap narrowed in July thanks to a post-Brexit vote boost to exports.

The Office for National Statistics (ONS) said the UK’s deficit on trade in goods and services hit £4.5 billion, shrinking from £5.6 billion in June.

However, the figure came in shy of expectations, with economists pencilling in a figure of £4.2 billion for July.

The brighter picture for UK trade was driven by a jump in exports, lifting £800 million to £43.8 billion.

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 £300 million to £48.3 billion.

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.”

He added: “While the pound has recently firmed from its post-Brexit vote lows, it is still at an extremely competitive level and is likely to remain so for an extended period.”