(Bloomberg) -- The last time the U.S. went into a recession, states and cities were left reeling from budget deficits so vast that they slashed their payrolls, cut deeply into spending and even raised taxes to stay afloat.

But bondholders were just fine.

In 2008, when the stock market plunged and the collapse of Lehman Brothers Holdings Inc. unleashed financial havoc worldwide, bonds backed only by states’ and cities’ promise to repay them still posted a return of 1.5%, according to Bloomberg Barclays indexes. The next year, they returned nearly 10%. That wasn’t an anomaly. In 2001 -- when the economy was roiled by the bursting of the dot-com bubble -- the state and local debt rallied, with returns of 5% that year and 9% in 2002.

As markets worldwide signal growing concerns about an economic slowdown, municipal securities again seem poised to benefit, with yields plunging steeply on Wednesday to the lowest since at least 2011, according to Bloomberg’s benchmark indexes.

Related Story: Yellen: U.S. to Avoid Recession But Odds Have ‘Clearly Risen’

Pacific Investment Management Co. said that municipal securities offer a “late-cycle refuge” for investors. Bank of America Corp. said it expects tax-exempt debt to keep rallying through 2020 amid fears about the trade war with China. And there are signs that states and local governments might be better-suited for a downturn, should one emerge.

“We like munis -- we like how they hold up in recessionary environments,” said Jonathan Mondillo, head of municipals at Aberdeen Standard Investments. “We like how they hold up when there’s a broad market sell-off.”

That doesn’t mean they’re completely secure. The high-yield municipal market, where hospitals, businesses and real-estate developers can float tax-exempt debt, was hammered during the last crash, tumbling 27% in 2008. The recession also pushed a few governments, including Jefferson County, Alabama, and Detroit, into bankruptcy.

But overall, the market was insulated from such volatility. Much of that is due to the individual investors who tend to buy and hold the securities because they’re largely after tax-free income, Mondillo said. He said the firm is “cautiously bullish” on state and local debt given that prices on some securities hit record highs relative to Treasuries this year.

The individual buyer-base may ultimately provide a floor on how low municipal-bond yields can go, though. State and local debt tends to perform well during the beginning of recessions but then starts to under-perform Treasuries because of retail investors’ “resistance” to lower yields, said RJ Gallo, a senior portfolio manager and head of the state and local debt investment group at Federated Investors.

“As a high-quality asset class we would do fairly well, certainly in the early phases of any recessionary outcome,” he said on Bloomberg Television on Wednesday. He said Federated isn’t predicting a recession.

Another element in investors favor? There are signs that state and local governments’ finances might be better-prepared for a recession. Their total debt has been shrinking as states and cities remain resistant to borrowing, which stands in contrast to the federal government.

Moody’s Investors Service said in a May report that 22 states had improved their preparedness for a moderate recession. They’d be able to withstand such an event without seeing a “significant” credit impact.

State officials have also been cognizant to save the extra tax revenue they’ve seen amid the longest economic expansion on record. New Jersey, one of the states municipal-bond analysts worry most about, made a $317 million deposit in the state’s rainy day fund in fiscal 2019, its first deposit in over a decade. In Connecticut, another state facing large liabilities, the 2020-21 budget includes the largest rainy day fund in the state’s history.

Municipalities “certainly look a little bit stronger if we are heading into a recession this time around,” Mondillo said.

--With assistance from Taylor Riggs.

To contact the reporter on this story: Amanda Albright in New York at aalbright4@bloomberg.net

To contact the editors responsible for this story: Elizabeth Campbell at ecampbell14@bloomberg.net, William Selway, Martin Z. Braun

©2019 Bloomberg L.P.