The official figures will come as welcome reading to the chancellor George Osborne, as they showed the 12th successive month of falling year-to-date public sector net borrowing, excluding banks.
July traditionally sees a surplus thanks to big tax inflows.
The Office for National Statistics reported a July public finance surplus, excluding banks, of £1.29bn (€1.79bn).
The public finances were boosted by £18.5bn of income tax receipts, the biggest intake for a July since records began in 1997, and up almost £1bn on July 2014’s haul.
For the first four months of the 2015/16 tax year, public sector net borrowing was 24bn, down 23% on the same period last year.
British finance minister George Osborne said last month that he was aiming to bring down the budget deficit in the current financial year to £69.5bn (€96bn), or 3.7% of economic output.
In the 2014/15 financial year, the deficit stood at 4.9% of GDP, half its level in 2010 when Osborne’s Conservative Party first took power but still bigger than the hole in the finances of most other advanced economies.