June’s deficit was revised higher from -£6.28 billion to -£5.67 billion, helping to produce a surplus above the £0.2 billion that had been forecast.
Excluding banking groups, the public sector recorded a surplus of £0.184 billion against forecasts of a -£1 billion deficit.
The last time a surplus was recorded was in July 2002.
Disappointing data out of the Eurozone also failed to bolster sterling as it typically should.
Germany’s economic sentiment fell by 7.5 points to 10 in August, falling far short of the expected 15.
Fresh data out of the Eurozone today is likely to affect the exchange rate.
Laura Parsons, currency analyst at TorFX, said: “Better-than-expected UK borrowing data failed to give the pound any notable support on Tuesday.
“The GBP/EUR exchange rate also stuck to multi-month lows despite the German/Eurozone ZEW economic sentiment surveys disappointing forecasts.