Government borrowing has risen to its highest October level in five years amid evidence that the slowing of the economy, increased spending and Brexit preparations have taken a toll on Britain’s finances.

At a time when political parties have been vying with each other to promise higher spending, data from the Office for National Statistics showed the UK ran a deficit of £11.2bn last month – up £2.3bn on a year earlier.

Borrowing in the first seven months of the 2019-20 financial year was £46.3bn, an increase of £4.3bn on the same period in 2018-19. In five of the seven months, borrowing was higher than in the previous year.

Andrew Wishart, the UK economist at Capital Economics, said the latest figures left the public finances on course for their first year-on-year deterioration since 2009-10, when borrowing soared as a result of the damage caused by the financial crisis and subsequent deep recession.

The City had been expecting a smaller increase in the October deficit, to £9.3bn, with one unforeseen factor a £2.4bn annual jump in the amount spent by Whitehall departments on staff and goods and services. “We suspect that reflects Whitehall preparing for a possible no-deal Brexit at the end of the month,” Wishart said.

ONS revisions to the public finances data for the first six months of the year showed that the deficit was £4bn lower than had previously been thought, softening the blow from the poor performance in October.

Government borrowing is affected by the state of the economy, with slower growth leading to a reduction in tax receipts and higher public spending. Since the start of the financial year, the economy has moved sideways, contracting by 0.2% in the second quarter and expanding by 0.3% in the third.

The ONS figures showed the tax take in October was just 0.4% higher than in October 2018, with the weakness spread across taxes on income, consumption and companies.

Howard Archer, the chief economic adviser to the EY Item Club, said the deterioration in the public finances would continue.

“The budget deficit in 2020/21 is set to be lifted appreciably by the £13.8bn increase in public spending (4.1% in real terms and the fastest increase in 15 years) announced by the chancellor, Sajid Javid, in the spending review in September.

“Furthermore, the budget for 2019/20, which will presumably be held soon after the 12 December general election, looks certain to further loosen the fiscal strings given the varying promises made by both Conservatives and Labour in their campaigning. In particular, both parties are pledging to spend big on infrastructure to take advantage of record low borrowing costs.”

James Smith, Research Director at the Resolution Foundation, said: “With all main parties committed to balancing the books on current spending, this deterioration should be a reminder to whoever wins the election that the state of the public finances will continue to be a constraint on plans for higher public service spending or tax cuts in the next parliament.”