Media playback is unsupported on your device Media caption The BBC's Hugh Pym looks at the figures in detail

The UK public sector recorded a small but unexpected deficit in July.

Public sector net borrowing, excluding the cost of financial interventions, totalled £62m, according to the Office for National Statistics (ONS).

In the past two years, corporate and income tax receipts pushed the public purse into a July surplus, and markets expected a £2.5bn surplus this time.

The data remains subject to revision. The £823m surplus recorded in July 2012 was originally reported as a deficit.

The ONS said that public sector net debt - the total outstanding amount owed by the state - reached £1.193 trillion in the month, excluding borrowing to finance financial interventions, such as bank rescues.

That was equivalent to 74.5% of the country's gross domestic product (GDP) - the UK economy's annual economic output.

Analysis On the face of it, this is an awkward piece of news for the Treasury. July usually sees tax revenues flooding in from individuals paying under self-assessment and major companies. So a small deficit for the month does not look good. But it's worth remembering that there was a similar story this time last year, with a July deficit reported, which has since been revised up to a surplus. Future revisions may do the same for this latest set of figures. The Treasury argues that this is not a weak economy issue, as tax revenues are growing at the expected rate - the timing of public spending has affected the July data. But, as the chancellor knows, perception is important. A clear downward path for government borrowing is a lot easier to explain.

The figures benefit from a deal reached between the Treasury and the Bank of England last year, to credit the public finances with the net income earned by the Bank on the government debts it owns, as part of its quantitative easing stimulus policy.

Excluding the effect of this deal, public sector net borrowing last month was £488m, suggesting the turnaround in finances from July last year - before the deal came into effect - has been even sharper.

Borrowing in the first four months of the current fiscal year has reached £24.7bn including the effect of the Bank of England deal, or £36.8bn excluding it. This compares with £35.1bn in the first four months of the previous year.

Corporate tax payments

"July is usually the second highest month for receipts during the financial year, reflecting the timing of corporation tax and self assessment payments," said the Office for Budget Responsibility (OBR), which was set up by the current government to monitor the public finances.

The OBR pinned the blame for the poor performance on a strong rise in government spending, although it noted that spending can vary greatly from month to month.

Financial analysts played down the importance of the figure, with many saying they still expected to see steady improvement in the government's finances over the rest of the year, as the economy continued to recover.

"Obviously slightly worse than expected," said Peter Dixon, economist at Commerzbank. "But I think all-in-all, it's only a very small deficit.

"Revenues were up versus a year ago, but they were not strongly up given the strength of the economy, so you have to wonder why that was.

"The biggest problems appear to be at the moment on the spending side."

Total tax revenues in the month were 3.4% higher than a year earlier, with VAT, national insurance contributions and income tax all netting significantly more.

The OBR noted that this was well ahead of the 2.4% revenue growth rate that it had forecast.

"Strong tax receipts in July confirm that the economy is moving from rescue to recovery," said a Treasury spokesperson.

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

But corporate tax receipts fell slightly, from £7.1bn to £7bn.

"This shortfall could be a result of significant falls in our oil and gas reserves and the weakening of our financial sector," said David Kern, chief economist for the British Chambers of Commerce.

"Despite this, we are still early in the financial year and if the economy continues to improve, we could see a more meaningful reduction in the deficit in the months ahead."

The economy grew 0.6% in the second quarter of this year, up from a 0.3% rate during the previous three months, with the faster pace expected by economists to continue into the autumn.

The faster growth rate typically translates into faster tax revenue growth, as well as lower spending on unemployment benefits.

"Another month of disappointing figures raises very serious concerns that borrowing continues to be way off track," said Chris Leslie, the Labour Party's shadow financial secretary to the Treasury, adding that the chancellor's "promise to balance the books by 2015 is now in tatters".