The public coffers usually show a surplus for July due to big tax payments by companies and individuals but these were outstripped by a rise in spending by Whitehall departments.
Last month's deficit was much worse than economists' average prediction of a £2.5bn surplus and they said the figures suggested Britain's improving economy had yet to boost the state's finances. But the Treasury said the economy continued to move from "rescue to recovery" after the Office for National Statistics reported higher tax receipts. The ONS said public sector net borrowing swung £1.3bn into the red in July from an £823m surplus a year earlier.The figures also showed underlying public sector net debt as a proportion of the UK's gross domestic product or total output hit a record for July at 74.5%.
Chris Leslie for Labour said: "Another month of disappointing figures raises very serious concerns that borrowing continues to be way off track."
The shadow Treasury minister stressed how in the first four months of the year, the deficit, far from falling, was higher. "The Government has borrowed £36.8bn - £1.6bn more than in the same period last year. As the Office for Budget Responsibility has made clear, deficit reduction has stalled."
But a Treasury spokeswoman said strong tax receipts in July showed the economy was moving from rescue to recovery, saying: "There is still a long way to go as the UK recovers from the biggest economic crisis in living memory and the Government is sticking to the economic plan that has already cut the deficit by a third and enabled the private sector to create over 1.3m new jobs."