LONDON—U.K. Prime Minister Liz Truss’s resignation is a stark reminder of how high inflation and rising interest rates have changed the game for politicians and narrowed their room to maneuver.

For the past decade, low inflation and ultralow interest rates gave governments around the world room to spend more and pile on debt without alarming investors. Those days are over.

With central banks tightening monetary policy, political leaders are less able to borrow money without raising questions about how they will repay it, in part because higher borrowing costs make debt more expensive and in part because governments already loaded up on debt during the Covid-19 pandemic.

Britain is a case in point. Debt as a proportion of economic output went from about 80% prepandemic to roughly 100% now.

Ms. Truss, now Britain’s shortest-serving prime minister, found this out the hard way. She and her ex-Treasury chief, Kwasi Kwarteng, wanted to stoke growth by slashing taxes, while also splashing out billions of pounds on subsidies to protect homes and businesses from rising energy bills.

Crucially, this was going to be paid for by borrowing rather than spending cuts. That same plan a year or two ago might not have raised many eyebrows, economists say.

This time around, however, the market reaction was severe: The pound sank to a record low, and the chaotic selloff of U.K. government debt, compounded by an unforeseen problem in the pension market, forced the central bank to step in and spend billions of pounds to stabilize the bond market.

“What we saw here was the combination of the wrong fiscal policy at the wrong time—an unfunded commitment at a time when rates are going up,” said Jonathan Portes, a professor of economics at King’s College London.

Ms. Truss was eventually forced to backtrack on her plans, and, her credibility and popularity in tatters, she was forced to resign by her party’s lawmakers.

Mr. Portes said he would be wary of drawing the conclusion that markets will always demand their pound of flesh in spending cuts instead of more borrowing. He said he believed spending cuts carried out by the U.K. in the years after 2012 in the name of austerity were wrong because interest rates were low at the time. This time around, they are rising.

‘What we saw here was the combination of the wrong fiscal policy at the wrong time—an unfunded commitment at a time when rates are going up.’

— Jonathan Portes, professor of economics at King’s College London

The U.K.’s new chancellor, Jeremy Hunt, has largely made peace with the markets. He shelved the lion’s share of the tax cuts, and promised “eye-watering” spending cuts to bring debt under control in coming years, foreshadowing some tough decisions for the Tory party in the weeks and months to come. U.K. borrowing costs have fallen sharply again, and the pound has strengthened.

The fallout from Ms. Truss’s fiscal plans can easily be seen in the price of U.K. government borrowing in recent weeks. Before Ms. Truss came into office, the U.K.’s borrowing costs were well below those of the U.S. On Sept. 1, the yield on a U.K. 10-year government bond yield was at 2.882%, compared with the U.S. 10-year’s 3.264% yield.

That relationship flipped when the Truss administration unveiled its plans for tax cuts, which sent U.K. borrowing costs soaring. Within days, the U.K.’s 10-year benchmark borrowing costs had shot more than half a percentage point above those of the U.S. Adding to the rise were troubles linked to derivatives in the pension market.

Liz Truss and ex-chancellor of the exchequer Kwasi Kwarteng wanted to spur growth by slashing taxes while spending billions of pounds on subsidies to protect homes and businesses from rising energy bills.

Photo: Stefan Rousseau/Associated Press

After the U.K. government ditched its plans, the spread again reversed. The yield on a 10-year U.K. government bond was at 3.910% on Thursday, compared with 4.210% for the U.S. Treasury note. Yields fall as prices rise.

“This has given a lesson to the Conservative party, but also to other governments around the world, about the power of markets,” said Susannah Streeter, senior investment and markets analyst at Hargreaves Lansdown. “If they’re not happy, they’ll desert that government debt and drive borrowing costs sharply higher.”

Economists also said the way in which the tax cuts were announced contributed to the severity of the market’s reaction. Typically, tax changes come with a reality check from an independent budget watchdog, but Mr. Kwarteng abandoned that tradition and then suggested further tax cuts were possible even as investors were wondering exactly how much new debt they would be asked to buy.

Credibility, once lost, isn’t easily regained, according to economists and investors.

“Whoever takes over as Prime Minister from Liz Truss will probably have to tighten fiscal policy in the Medium-Term Fiscal Plan, rather than just reverse the previous loosening, to prove their fiscal restraint to the financial markets,” wrote Paul Dales, an economist at Capital Economics, in a note to clients.

For other European countries, the lesson is they have to be careful with spending programs, particularly at a time when many are also offering subsidies on energy to counter painful increases in natural-gas prices from the war in Ukraine.

The U.K.’s new chancellor, Jeremy Hunt, has largely made peace with the markets, shelving the lion’s share of the Truss administration’s tax cuts.

Photo: HENRY NICHOLLS/REUTERS

European governments will issue a net €385 billion, equivalent to about $377 billion, in debt next year, in part to fund energy-support programs to shield households and businesses, according to estimates by Danske Bank. Investors haven’t been spooked by those plans yet, in part because they see them as more targeted than the U.K.’s tax-cutting plans.

Still, some countries may struggle to issue significant debt without the support of the European Central Bank, which bought trillions of euros of government bonds over the past decade in a process known as quantitative easing that helped keep borrowing costs low. The Bank of England recently said it wouldn’t only not buy more government bonds following its short-lived intervention, but actively sell bonds—quantitative tightening. The ECB is expected to follow suit next year.

“There is a lesson here,” said Jim Leaviss, chief investment officer of public fixed income at M&G Investments. “Governments have had the support of [quantitative easing] for a long time. Markets are coming around to the idea that doesn’t exist anymore.”

Mr. Leaviss added that governments will have to be more conservative in their spending plans. “The Trussonomics phase will not be coming back for a while,” he said.

Even after the tax reversals by the U.K. government, economists estimate that the government may need to cut spending or raise taxes by between £30 billion and £40 billion, equivalent to about $34 billion to $45 billion, to meet its self-imposed fiscal targets, the most important of which is to have its debts falling relative to the size of the economy by the fiscal year ending April 2025.

Some options for the government include a windfall tax on the profits of energy companies, which have been boosted by Russia’s invasion of Ukraine, or higher taxes on bank profits, which have been boosted by rising interest rates. On the spending side, economists say a commitment to raise military spending could be delivered over a longer time period, while some investment spending could be put on hold.

One big question is whether the new government will increase welfare payments in line with the annual rate of inflation, which stood at 10.1% in September. Were the government to decide to link those payments to the much slower rise in wages, it would save many billions of pounds, but risk both political fallout and inflicting additional hardship on already hard-pressed households.

One other lesson from Ms. Truss’s short period in office is that in a time of high inflation, any attempt to stimulate the economy through tax cuts or spending increases will likely trigger an offsetting response from the central bank.

BOE officials have said they now expect to raise their key interest rate further than they had anticipated before the tax cuts were announced, further boosting borrowing costs for households and businesses that have been on the rise all year.

However, they may not go quite as far as participants in financial markets expect. They see the BOE’s key interest rate peaking at around 5.25% next year from 2.25% now. BOE Deputy Gov. Ben Broadbent Thursday said such a rise in rates would send the U.K. economy into a deep contraction.

“Whether official interest rates have to rise by quite as much as currently priced in financial markets remains to be seen,” Mr. Broadbent said in a speech at Imperial College in London.

Write to David Luhnow at david.luhnow@wsj.com, Paul Hannon at paul.hannon@wsj.com and Chelsey Dulaney at Chelsey.Dulaney@wsj.com

Corrections & Amplifications
Jim Leaviss is chief investment officer of public fixed income at M&G Investments. An earlier version of this article misspelled the company’s name as M&GH Investments. (Corrected on Oct. 21)