Foreclosure is a long and heartbreaking process for a homeowner. But, it’s not hopeless. When looking for a solution to defaulting on their mortgage payments, many owners float this question: “Can I sell my home if it is in foreclosure?” The short answer is yes.

Up until the home is sold at auction, you can rescue your home by selling it and paying the lender everything you owe, including back payments and penalties. And in some states, you  are allowed a “statutory right of redemption.” This is essentially a take-back period after the foreclosure—from 30 days to as much as two years in some places —in which you can repurchase your home.

“If you can pay off what you owe the mortgage company, including all interest and fees, you can take the home back or sell it if you have a buyer,” says Lou Sansevero, a Realtor® with Atchley International Realty, in Lakewood Ranch, FL.

How does foreclosure work?

A foreclosure starts when the homeowner is issued a notice of default after your fourth missed payment. The whole process can take from six months to one year or more, depending on the negotiations between you and your lender.

Can I sell my home after foreclosure has begun?

You can sell your home up until it is sold at auction or the bank takes possession of your house. During this period of time, the home is considered to be in “pre-foreclosure” and you can try to settle your debts with the lender.

One way to avoid foreclosure is to sell your home (with the help of an experienced agent) and net enough to pay off everything you owe the lender, including back mortgage payments, penalties, and fees. You won’t own your house anymore, but you won’t have the house foreclosed upon, which would do serious damage to your credit.