Raiding your 401(k) or other retirement savings may seem like a doable way to pay back your creditors, retrieve some urgently needed money or stave off the approach of bankruptcy, but it’s a massive mistake you don’t want to make.

Retirement money is normally immune

Your 401(k) is considered a protected asset by federal law and thereby exempt from chapter 7 bankruptcy. The same protection applies to most retirement accounts, including IRAs, SEP and Simple IRAs, Roth IRS, Keogh plans and pension plans, so they can’t be taken by creditors or your U.S. trustee when you file for bankruptcy. Even if the majority of your other assets are seized to pay down your debts, your retirement savings should be secure.

Remember—don’t touch your savings!

These funds are only protected if you keep the money in your 401(k) or other retirement account. If you transfer any or all of your 401(k) into a regular checking or savings account, the money will be deemed an unprotected asset and can be seized in the bankruptcy.

If you empty your retirement account before you file for bankruptcy, you can put yourself in a horrible position. Your credit report will take a sizable blow, and you’ll have no savings to fall back on as you get older. It can be really difficult for retired people to rebuild their finances, since many factors, like age discrimination in hiring, health issues and family caregiving duties can make it challenging for them to find gainful employment.

Cashing in your 401(k) to deal with debt problems is a bad idea, but it’s a mistake many older Americans make because they don’t fully understand bankruptcy or know the wonderful fact that their retirement savings are protected.

If you need to file for bankruptcy, before you even think about touching those retirement savings, understand your legal options and what steps you’ll want to take to safeguard your future in the golden years and get you back on financial track.