S&P’s is poised to downgrade thousands of municipal bonds that are directly tied to the federal government, with an announcement expected later this week. In July, Moody’s recommended downgrading 7,000 muni bonds if the U.S. credit rating went down. While this secondary wave of downgrades is unlikely to shock the municipal bond market, it could reveal the vulnerable finances of some of the country’s more fiscally troubled towns and cities, ultimately putting them on shakier footing by making borrowing more expensive.

On the surface, municipal-bond watchers seemed relatively confident about the near-term health of the $2.9 trillion municipal market, where bond yields have remained low -- a key indicator of investor confidence.

“The trend has been that they’ve been benefiting from the flight to security,” said Richard Ciccarone, managing director of McDonnell Investments. The bonds most likely to be downgraded will be “the safest of muni holdings” most closely tied to Treasurys, Ciccarone adds. The thinking goes: Because investors haven’t abandoned Treasurys, they won’t flee from muni bonds, either.

Many states and cities forced by law to balance their budgets have made painful, sweeping cuts to improve their balance sheets this year, and they’ve anticipated further cutbacks in federal aid. And they’re going to be better positioned for whatever comes next.

But then there are states and municipalities relying more heavily on federal support that are already on shaky fiscal ground. The federal government has committed to slashing trillions in funding under the debt-ceiling deal, and as such cuts materialize, they could have an outsize impact on these municipalities.  

“The weaker the government it is, the less able it is to provide on its own and the more dependent it is on revenues from above,” said Matt Fabian, managing director of Municipal Market Advisers, a Boston-based strategy firm. Particularly vulnerable might be large public housing projects that receive a federal guarantee as well as bonds underwritten by federal aid for transportation projects,  Ciccarone said.

Standard and Poor’s itself suggested that federal spending cuts, without new revenues, could impact its credit ratings of municipal debt. “We said we would be looking carefully at some of the indirect effects, if you like, on possible fiscal consolidation programs in Washington as they might impact the budgetary decisions of state and local governments,” an S&P official said on a Monday conference call, as Bloomberg reported.

During the last sharp downturn in 2008, the federal government provided a short-term stimulus to state and local governments that help prop up the muni market. This time, there’s little expectation that it would be willing or able to do the same. Facing burgeoning Medicaid costs, for instance, “they’ll probably push the problem back down to the state and local governments,” Fabian said. “That’s a problem we’re concerned about ... and that’s when we do individual credit reviews, to see if there are implied [federal] support lines that shouldn’t be taken for granted.”

S&P’s second wave of downgrades is already raising greater concern for cash-strapped states and municipalities that rely heavily on federally financed housing. On Monday, S&P announced that the biggest sources of financing for federal housing -- Fannie Mae, Freddie Mac and the Home Loan Bank Board -- would all be downgraded. There are already small signs that investors are responding: Ciccarone pointed out that the some Fannie and Freddie holdings showed wider yields than U.S. Treasurys on Monday, suggesting that investors could have less confidence in those assets going forward. “There’s a chip in that piece of art,” he said.

Investors are unlikely to lose faith in Fannie and Freddie anytime soon, but such a drop in confidence would be a “double whammy” for public housing on the local level as well. “Any state or local housing finance agency bonds issued for low- or moderate-income housing backed by Fannie or Freddie or FHLB will likely be downgraded. That would increase the interest rates -- and thereby the cost, creating fewer units at higher rents,” said Frank Shaforth, director of George Mason University’s Center for State and Local Government Leadership. The fear, Shaforth added, is that higher interest rates would also reduce assessed property values, further reducing revenues to local governments that are struggling to fund schools, roads, sewers and other basic infrastructure.

Given the relatively low rate of municipal bankruptcies to date (five municipalities filed for Chapter 9 in the first half of the year), there’s little fear that investors will suddenly lose faith in state and local governments’ ability to repay their debts, with Treasurys still a reliable backstop. But at the end of the day, unlike Treasurys, “munis are not cash, they have credit risk,” Fabian noted. “The market has grown warier.” And local governments could pay the price of such newfound uncertainty.