There is an often-overlooked feature of the Roth IRA: emergency fund. Subject to income limits, you can contribute as much as $5,500 annually into a Roth IRA. If you’re married, you and your spouse can each contribute $5,500, for a total of $11,000.

The reason that Roth IRA can be your emergency fund is because you can withdraw contributions anytime; it’s only a Roth’s investment earnings that must remain in your account until you’re 59.5 if you want to avoid paying a 10% penalty. Roth IRAs offer this flexibility since you’ve already paid tax on your contributions, unlike traditional IRA contributions, on which you haven’t paid taxes yet.

The advantage to putting emergency savings into a Roth IRA is that you don’t miss the limited opportunity to make that year’s retirement contribution. You can only contribute a few thousand dollars to a Roth IRA each year, and once a year passes without you contributing, you lose the opportunity to make that contribution forever. Since the Roth has a relatively low annual contribution limit, you don’t want to miss out on making the full contribution for any year. The maximum you can contribute for the year, as of tax year 2016, is the lesser of $5,500, or your taxable compensation for the year. If you’re 50 or older, you can contribute the lesser of $6,500 or your taxable compensation for the year.

The IRS lowers the Roth IRA contribution limits if your filing status is married filing jointly or qualifying widow(er) and your modified AGI is $184,000 to $194,000; if your modified AGI is $194,000 or more, you can’t contribute to a Roth. Single filers and heads of household hit the reduced contribution threshold at $117,000 and are disqualified once their modified AGI is $132,000 or more. These limits apply to tax year 2016 and are likely to change in the future.

But the more you set aside for retirement and the earlier you do so, the better. Most people won’t have to go back later and withdraw that money from their Roth, which means they’ll have more saved for retirement. And in the worst-case scenario that you do have to take the money out, you can do so without penalty. Accessing these funds, however, should almost be your last resort. You don’t want to be withdrawing Roth IRA contributions for minor emergencies such as car repairs or small medical bills; you should keep enough in savings for these events. Your Roth IRA emergency fund should be for larger emergencies such as unemployment or a serious illness.

Only Withdraw Contributions

The key to using a Roth IRA as an emergency fund is to avoid withdrawing any investment earnings. While you can withdraw contributions at any time without penalty, if you withdraw earnings before age 59.5, you will pay a 10% penalty. Following this rule is simple: Don’t withdraw more than you’ve put in.

If you do have to withdraw contributions, you can pay yourself back and retain your Roth contribution for that year if you act fast. You can put the money back into the Roth IRA within 60 days to refund this account as if nothing happens.

Don’t Invest Emergency Fund Money

It is critical not to invest the portion of your Roth dedicated to your emergency fund. This money is for emergencies, which in most cases is job loss. If that job loss is part of a downturn in the economy, you will have to sell investments, usually at a loss. The part of your Roth IRA contribution that you want to use as your emergency fund doesn’t belong in stocks, bonds or mutual funds like a typical retirement contribution. It belongs in something liquid that still earns a bit of interest, but that you can withdraw at a moment’s notice without losing principal. Ally Bank, for example, has an IRA savings account that currently pays 0.87% interest.

The gains to the savings account will grow in the Roth without your having to pay taxes on the earnings every year like you would in a regular savings account. You also won’t have to pay tax on these earnings when you withdraw them as qualified distributions after you reach retirement age. A savings account within a Roth can earn at least as much interest as a regular savings account, if not more, depending on where you bank. If you already have a Roth IRA but your brokerage doesn’t have any low-risk places to keep your money while still earning interest, open a second Roth IRA at an institution that does. It’s fine to have multiple Roth IRA accounts, as long as your total contributions to all accounts don’t exceed the annual limit.

Once you have a large enough emergency fund, start moving those contributions into higher-earning investments; you don’t want all of your Roth contributions in cash forever. This process might take you a few months or a few years, depending on how quickly you can accumulate additional savings.

Don’t Withdraw Unseasoned Rollover Funds

If your Roth IRA contains contributions that you converted or rolled over from another retirement account, such as a 401(k) from a former employer, you’ll need to be careful about any withdrawals, because there are special rules about withdrawing rollover contributions. Unless they’ve been in your Roth for at least five years, you’ll incur a 10% penalty if you withdraw them, and each conversion or rollover has a separate five-year waiting period. Withdrawing rollover contributions penalty-free can be tricky, so it’s a good idea to consult a tax professional if you find yourself in this situation. The good news is that if you have both regular contributions and rollover contributions, the IRS first categorizes your withdrawals as withdrawals of regular contributions before it categorizes them as withdrawals of rollover contributions.

Know how Much Time it Takes to Get Your Contributions Back

What good is an emergency fund if you can’t access the money when you need it? Funds availability may differ depending on which institution you keep your Roth at and the type of account you place the money in. You don’t want to learn later, when you need money urgently, that it will take days to get a check or bank transfer, so find out before making a contribution to your Roth IRA how long it will take to get it back.

Depending on how you’ve invested the money, you can get the majority of your savings in less than three days. If it’s in a money market or mutual fund and you call to withdraw before 4 p.m. EST, you will get the money by the next business day. If it’s invested in stocks you will need to wait three business days. To be able to get it immediately you need to have a checking account with the same company that you have your Roth IRA with.

A wire transfer can also be a fast way to access funds, though you’ll have to pay a wire transfer fee that’s typically $25 to $30.

These potential delays in Roth IRA funds availability are another reason to keep some emergency cash outside of your Roth IRA, in your checking or savings account, for extremely urgent needs.

Fill Out the Correct Paperwork at Tax Time.

If you do need to withdraw contributions from your Roth IRA to use in an emergency, there’s paperwork involved. Even though you’re allowed to withdraw contributions without penalty, you still have to report your withdrawals to the IRS on part III of form 8606.

If you use tax preparation software, it will ask you if you made any withdrawals from a retirement account during the year and guide you through the paperwork. If you use a professional tax preparer, make sure to tell him or her about your withdrawal so he or she can fill out IRS form 8606 for you. If you only put money in your Roth and don’t take anything out, you have nothing extra to do at tax time. You don’t need to report Roth IRA contributions on your tax return since you’ve already paid tax on that income and contributions don’t reduce your taxable income.

Also, if you make your Roth contribution before the income tax filing deadline for the year and need to withdraw that money before the filing deadline, the IRS treats these contributions as if you had never made them. You won’t need to report them at tax time.

Redeposit Early Withdrawn Contribution

If you have enough cash within 60 days of withdrawal, it is possible to redeposit the early withdrawal back. An IRS loophole allows you to take a 60-day loan from your Roth once every 12 months. The IRS allows rollovers between IRAs once every 12 months. As long as you transfer the money within 60 days, you don’t have to pay taxes or penalties on the rollover. Because the rules don’t stipulate that you can’t rollover money to the same account, you can take money out of your Roth, use it for 60 days, then return it to the account. If you don’t get the money back in time, the rollover becomes a distribution, possibly triggering taxes and penalties.

This operation is made possible by modeling it as an indirect Roth-to-Roth rollover, which subjects to the once-per-year rule. There are other types of rollovers are not subject to this once-per-year rule:

  1. A rollover from a Traditional IRA to a Roth IRA (i.e., a conversion).
  2. A rollover to or from a qualified plan, such as a 401(k) or 403(b).
  3. A trustee-to-trustee transfer (i.e., direct rollover) is not subject to the limitation.

For more information, please refer to the IRS article.

The Bottom Line

The Roth IRA is the perfect place to stow those “just in case” funds while also taking advantage of the opportunity for tax-free growth, and tax-free income, in retirement.

While the IRS calls the types of withdrawals described in this article “unqualified,” which makes it sound like you’re breaking a rule, it considers them a “return of your regular contributions” and does not tax or penalize them. “Qualified” distributions are simply those that have been in your Roth for at least five years and that you withdraw after age 59.5.

You have 15.5 months each tax year to accumulate emergency funds to place in a Roth. For example, for tax year 2014, you can make contributions any time from Jan. 1, 2014, through April 15, 2015. To learn more, see IRS Publication 590.