Though investing in stocks is a great way to grow wealth, you need safer investments, like bonds, in your portfolio as well to offset the risk of buying stocks, especially as you start getting closer to retirement. And in that regard, you have choices. You can buy corporate bonds -- those issued by corporations -- or you can buy municipal bonds, which are issued by state and local governments.

The benefit of municipal bonds is that their interest is always tax-exempt at the federal level, and if you buy municipal bonds issued by your state of residence, you avoid state and local taxes as well. Tax-free interest aside, municipal bonds come with historically low default rates compared to corporate bonds, making them a relatively secure investment -- most of the time.

But municipal bond defaults do happen. Think back to Detroit, which declared bankruptcy in 2013. Bondholders back then took serious losses in the course of the bankruptcy process, and those who own municipal bonds today face a similar risk thanks to the COVID-19 pandemic.

Road running through city

Image source: Getty Images.

Are your municipal bonds at risk?

Small investors make up about 67% of the $3.8 trillion municipal bond market, so there's a good chance you own some in your investment portfolio. It could be the case that you either own individual bonds, or that you own mutual funds that are invested in them.

Normally, municipal bonds are notably safe. General obligation bonds are backed by the taxing power of the governments that issue them, while revenue bonds are tied to specific revenue streams (think toll roads, for example). But during the COVID-19 outbreak, a lot of states and cities are losing out on revenue. When you take high levels of unemployment and combine it with sluggish consumer spending, the result is less income and sales tax, which puts municipalities at risk of defaulting on their bond obligations -- namely, by missing scheduled interest payments or, worse yet, failing to repay bondholders their principal once their bonds come due.

Of course, municipalities that anticipate difficulties in meeting the terms of their bond contracts can't just sweep that under the rug. Rather, they need to submit disclosures to that effect. But once that happens, they risk having their credit ratings downgraded, making them a less healthy, or enticing, investment.

Meanwhile, it's estimated that governments have submitted more than 2,200 disclosures in the course of the COVID-19 pandemic. And while a single missed interest payment won't necessarily correlate to a bankruptcy filing down the line, that possibility can't be discounted. Unfortunately, bondholders aren't always made whole in the course of bankruptcy proceedings. To put it simply, municipal bonds with a face value of $10,000 could wind up being worth $6,000 after all's said and done.

And there lies the danger of municipal bonds today: With so many states and cities hurting for revenue, bondholders face the potential for serious losses, either in the near or not-so-distant future.

Should you unload your municipal bonds?

Just as investors are often told not to panic-sell and unload stocks when their value declines, so too should you not rush to dump every municipal bond in your portfolio. But what you should do is pay attention to bond ratings. The lower an issuer's rating, the greater the risk of it defaulting on an interest payment or running into serious financial trouble, so if you have bonds in your portfolio that are being downgraded, it could pay to sell before things get worse.

If you own mutual funds that are invested in municipal bonds, selling those bonds won't be your decision to make -- and chances are, you won't even know you're invested in them in the first place. But if you're worried, take a look at each fund's prospectus to find out where its money goes.

Will municipal bonds get hammered by COVID-19?

The longer the pandemic drags on, the greater the risk that municipal bonds will take a hit. Exactly what that means for you as a bondholder is difficult to predict.

Even when municipalities declare bankruptcy, there's a spectrum of consequences for investors, and the extent to which you may or may not lose money will depend on the financial condition of each individual bond issuer. Right now, you don't need to rush out and banish municipal bonds from your portfolio, but be mindful of the hit those bonds could take if the economic crisis we're currently faced with gets worse before it gets better.