LONDON - British public borrowing last month was almost a fifth lower than a year earlier, when the economy was feeling the full force of the coronavirus pandemic, but rising inflation put upward pressure on debt costs.

Public sector net borrowing, excluding public sector banks, fell to 22.8 billion pounds ($31.0 billion) in June, still the second-highest June figure on record. Economists polled by Reuters had forecast a drop to 21.6 billion pounds.

Reflecting the surge in borrowing by British finance minister Rishi Sunak to soften the hit from the pandemic, the data showed Britain's budget deficit leapt to 14.2% of gross domestic product during the financial year to the end of March 2021, its highest share of GDP since World War Two.

"We still expect borrowing to undershoot the OBR's latest forecast for this year. But we are not out of the woods yet, with the recent surge in COVID-19 cases putting some parts of the economy at risk of further restrictions later in the year," KPMG economist Michal Stelmach said.

The Institute for Fiscal Studies, a think tank, said in a report with economists from Citi that borrowing in the 2021/22 financial year would drop to 9.3% of GDP. This is 30 billion pounds less than the government's forecasters expected in March but would still be the third-highest on record.

The Office for National Statistics said June's debt servicing costs - which include an inflation uplift to index-linked gilts' future redemption values as well as actual interest payments - rose to a record 8.7 billion pounds.

A rise in the rate of retail price inflation was largely to blame, it added.

However, debt servicing costs as a share of GDP remain low by historic standards, and most economists say the pace of economic recovery will be the key factor in improving the public finances.

"The economy can do more of the job in 'fixing' the public finances than a fiscal tightening," Ruth Gregory of Capital Economics said.

Public borrowing for the first three months of the financial year totalled 69.5 billion pounds, down more than 40% from the three months to June 2020, when Britain recorded its heaviest-ever borrowing in cash terms due to its COVID spending surge.

But public debt as a share of GDP, excluding public sector banks, was 2.218 trillion pounds or 99.7% of GDP in June, its highest since March 1961.

"It's ... right that we ensure debt remains under control in the medium term, and that's why I made some tough choices at the last budget to put the public finances on a sustainable path," finance minister Rishi Sunak said.

Sunak's support for furloughed workers and a tax break on property purchases are being phased out, while a temporary increase in the main benefit for the unemployed and low-earners will stop on Oct. 1. Overseas aid spending has also been cut.

Sunak is due to hold a review of government spending before the end of the year.

The IFS think tank said that although the short-run outlook for the public finances was better than in March - giving scope for one-off giveaways - the long-term prospects pointed to spending cuts for some government ministries unless taxes rise.

($1 = 0.7354 pounds)

(Reporting by David Milliken and William Schomberg Editing by Peter Graff) ((david.milliken@reuters.com; +44 20 7542 5109; Reuters Messaging: david.milliken.thomsonreuters.com@reuters.net))