Government borrowing was higher than expected in August as debt interest payments rose due to higher inflation.
Borrowing, which is the difference between tax income and spending, was £20.5bn, official figures show - £5.5bn lower than in August last year.
However, it was still the second-highest figure for August since records began.
Economists had expected government borrowing to be about £15bn.
Borrowing has been at record levels, with billions being spent by the government on measures such as the furlough scheme to support the economy.
This high spending, combined with less money coming into the exchequer due to the pandemic and a fall in economic output, has pushed government debt up to more than £2.2 trillion, or about 97.6% of GDP - a level not seen since the early 1960s.
The interest payments on government debt were £6.3bn in August. That was £2.9bn more than in August 2020, but lower than the monthly record of £8.7bn in June 2021.
Danni Hewson, a financial analyst at AJ Bell, said: "Inflation is not just something that's making us wince when we get to the supermarket checkout, it's also taking its toll on the public purse.
"Interest payments on all that debt shot up in August and September will be even more painful".
The government borrowed a total of £325.1bn in the financial year to March, which amounts to 15.5% of GDP, the highest percentage since the end of World War Two.
The figure was an increase of £27.1bn compared with the previous Office for National Statistics (ONS) estimate, which was largely due to the expected cost of £20.9bn on guarantees on loans to firms that will not be able to pay back.
Isabel Stockton, research economist at the Institute for Fiscal Studies, noted that this estimate suggested that non-repayments would total just over a quarter of the £80bn loaned out.
"This is a big number, but not as big as feared by the Office for Budget Responsibility whose Budget 2021 estimate was that £27bn would not be recouped," she said.
Ms Stockton added that for the public spending figures, the precise size of last year's spike in borrowing "is not all that important".
"What matters more are the strength of the eventual recovery, whether current strength in tax receipts persists into future years and whether the large income tax, corporation tax, and National Insurance tax rises announced since March are actually implemented as planned."
While borrowing this year is coming into land better than the gloomy forecasts of the OBR, in August it was still higher than expected, and the second highest on record.
It was the direct impact of rising inflation on borrowing costs that drove the figures.
While the chancellor is still heading for some extra room for manoeuvre ahead of next month's Budget and Spending Review, there is also some room for reflection in the revision to last year's borrowing numbers.
The post war record for borrowing last year was revised up substantially to £325bn, driven by more than £20bnn in expected losses on government-backed Covid contingency loans.
This is a significant sum, about a quarter of such loans, reflecting the hidden extent of corporate distress. Though this figure is lower than some original estimates of write-offs.
The ongoing economic recovery will also help ensure this figure does not rise further.
Chancellor Rishi Sunak is due to deliver a new Budget and growth forecasts on 27 October, as well as new multi-year spending limits for individual government departments.
Ruth Gregory, senior UK economist for Capital Economics, said: "With the chancellor intent on signalling in his Budget on 27 October that the fiscal stimulus seen since the pandemic is now firmly at an end, the big fiscal boost to the economy last year will soon become a fiscal drag."
She said that while tax revenues of £61.2bn were higher that last August's £55.8bn, government spending was "elevated" in August, including £1.1bn on the furlough scheme as well as £2.1bn on the self-employment income support scheme.
However, she added that the figures showed that "the government's financial position isn't as bad as the Office for Budget Responsibility predicted back in March".