• Trade deficit came in at £7.8bn, down from £8.2bn in July • Exports rise to £25.5bn • US remains the biggest export market • America's trade gap also falls

Britain's exporters shrugged off the global downturn to push sales of goods to a record high in August, news that will be a welcome boost to chancellor George Osborne.

Britain's trade deficit with the rest of the world narrowed more than expected as exports rose and imports fell slightly, reflecting softer domestic demand. The deficit came in at £7.8bn, down from £8.2bn in July and well below economists' consensus forecast of £8.8bn.

A separate report from the US commerce department showed that America's trade deficit also narrowed in August to $45.61bn (£29.07bn) from $45.63bn the previous month. Economists had expected it to widen to $45.8bn.

The UK's Office for National Statistics said exports were valued at £25.5bn, up 0.6% from July and the highest level since monthly records began in 1998. That will bring some respite to the government as it looks to exporters to pick up the slack from lacklustre domestic demand.

The data contrasts with business surveys suggesting export orders have been softening as key trading partners in the eurozone grapple with the sovereign debt crisis and stalling growth.

Economists cautioned against reading too much into one month of trade numbers, which can be volatile, but said there was no denying the positive surprise.

"The UK's trade numbers are very strong," said James Knightley at ING Financial Markets. "Goods exports have risen to an all-time high, despite intensifying recession fears, while imports fell marginally. We struggle to see this lasting given intensifying recession fears in the eurozone and a generally weak global growth environment, but it is good news for now."

The ONS said the rise in exports of goods was driven by exports of fuels to non-EU countries, followed by exports of intermediate goods such as components and unfinished products and then food, drink and tobacco, mainly to EU countries.

The British Chambers of Commerce welcomed the data. "The figures provide a welcome contrast to the steady flow of negative news we have recently," said David Kern, BCC chief economist. "However we cannot underestimate the challenges ahead for exporters, particularly in the face of the serious problems facing the eurozone, which remains our major trading partner.

"The government must support a national export drive. Unless we accelerate the pace of export growth and we gain market share from imports in the domestic market, it will be difficult to sustain UK growth. The government must strengthen its backing for SME exporters in key areas such as trade finance, insurance and promotion ... On their part, Britain's exporters must make every effort to diversify their sales towards fast growing economies such as India, China and Brazil."

The US was by far the biggest export market for the UK in August and exports to the US continued to rise. But exports to the next three biggest partners – Germany, France and the Netherlands – fell in value terms. Ireland saw the biggest rise in UK export values during the month, with an increase of £0.2bn.