When you’re buying a home, the sale can fall through for many reasons. If you’re having second thoughts and want to back out of an accepted purchase offer, things can get complicated.

It’s not impossible for a buyer to back out of a signed real estate contract with a seller, but there could be repercussions — especially if no escape hatches were included in the deal. Knowing what could happen is critical, so that you understand your financial and legal rights as a homebuyer. Here’s what to expect if you’re thinking about rescinding an accepted offer.

Can a buyer back out of an accepted offer?

The short answer: yes. When you sign a purchase agreement for real estate, you’re legally bound to the contract terms, and you’ll give the seller an upfront deposit called earnest money. Earnest money shows the seller that you’re serious about purchasing the house and plan to follow through on the agreement.

“It’s not fair to the seller to pull their home off of the market if a buyer is not totally serious,” says Marc Hagerthey, a real estate agent with Keller Williams Gateway in Nottingham, Maryland. “The earnest money will sit in an escrow account and will be used to pay a portion of the closing costs at settlement.”

However, putting certain contingencies in place makes it perfectly legal to back out of an accepted offer if those contingencies are not met. The contingencies spell out situations when backing out without penalty is acceptable. In most cases, you’ll get your earnest money back.

Backing out with a contingency

A standard real estate contract typically comes with a number of contingencies — these are the conditions that need to be met in order for you to move forward with a home purchase. This includes a mutual agreement of specific tasks that have to be completed within a certain time frame.

Homebuyers might include contingencies for the home inspection, securing financing with their lender, selling their own home first or the home appraising for less than the sale price. In other words, if you back out of an offer based on a contingency, you can do so with little fuss and still get your earnest money deposit back.

Let’s say a home inspection report comes back and there are costly issues, such as a damaged roof that needs to be replaced or cracks in the foundation. With a home inspection contingency in place, you can walk away from the deal, especially if the seller refuses to fix the problem or offer credits to offset the costs. The financing contingency is another important safeguard. It gives you an out if your lender doesn’t pull through with a loan approval.

Pay careful attention to the contingency deadlines outlined in the agreement. For example, you might be required to complete a home inspection (and ask for repairs/credits) within seven to 14 days after the contract is assigned. A financing contingency might need to be met within 30 days to get final loan approval. If you need more time to complete a contingency task, your real estate agent will likely need to file a contract addendum that the seller must approve to get your extension.

Backing out without a contingency

This is where things can get tricky — and potentially ugly. If you’re backing out of an offer without a contingency in place, you risk losing your earnest money. Since you put that money down based on the promise that you would follow through with the contract, backing out for any reason that’s not outlined in the agreement means the seller is legally permitted to keep your money.

Not only do you risk losing your earnest money, but the seller could possibly seek further legal action. You could be sued for what’s called “specific performance,” in which the court forces the buyer to close on the home.

“It’s pretty rare that this happens,” says John Graff, CEO of Ashby & Graff Real Estate in Los Angeles. “You’re more likely to see the courts ordering a seller to close a sale, not the other way around.”

When is it too late for a buyer to back out?

Outside of contingency periods, it’s easier to back out of buying a house before the purchase agreement is signed. If you decide to exit after that point, or after the contingency periods have expired, you’ll have a much harder time doing so without landing in legal or financial trouble.

In some states, home purchase agreements have a clause that requires both parties to agree to mediation if there is a dispute. That means you’ll have a chance to plead your case to the seller directly with the help of a neutral mediator — and, hopefully, resolve the issue outside of a courtroom.

Bottom line

Buying a home is a serious commitment and shouldn’t be taken lightly. If you do need to back out of an accepted offer, be upfront with the seller as soon as you’ve made your decision. Work closely with your real estate agent, who can help you communicate to the seller (in writing) why you want to back out. If that doesn’t work, you may need to consult with a real estate attorney, who can best advise you regarding your rights and what to expect if mediation is unsuccessful.

Ultimately, you may lose your earnest money if you back out of a contract without a good reason. However, buying a home you don’t want or can’t afford might be a more expensive mistake in the long run.