Should you buy a house with a bad septic system? You might wrestle with this question if you fall in love with a home only to find out during the home inspection that the septic system is in serious disrepair.

Properties usually have septic systems for one of two reasons: The home is in a rural area with no public sewer available or the home is older, and while it previously didn’t have access to a public sewer, it now does—but may have not been hooked up yet.

The good news is that a bad septic system doesn’t automatically mean you should flush your hopes of purchasing the home. Here’s when a bad septic system is a deal breaker and when it’s not.

Bad septic system: Repair or replace?

Septics are a simple system—water goes into the septic tank and displaces the same amount of water that travels to the drain field, says agent Adam Wise of Pearson Smith Realty in Washington, DC.

Common problems with septics include tree roots impacting the soil around the drain field. A simple fix could be as easy as clearing the roots. Or a septic may be failing because a tank baffle—what separates a tank from the drain field—needs repairing. In both cases, a septic professional can inspect the system and determine if a repair is possible. Such minor repairs may range from a few hundred to a few thousand dollars.

But here’s the thing: If there isn’t an easy fix available, a bad septic will need to be completely replaced, or it will fail. Failure means the septic can no longer treat and distribute wastewater. Signs that a house needs a new septic system include toilets that drain slowly and standing wastewater on the ground above the drain field.

How much does a septic system cost to replace?

If a house is listed at a lower price because of a failed septic system, it could be a tremendous steal depending on the type of system that will need to be installed, says Wise. The cost of installing a new septic in the same place as the old one usually ranges from $10,000 to $15,000, depending on the soil and the type of system that will be installed.

Septic systems and financing

Keep in mind a bad septic system complicates the buyer’s ability to finance a property.

“It’s often the case that the lender will require a working septic on traditional financing options,” says broker Holly Gray at Re/Max Pacific Realty in Bellevue, WA. “The FHA won’t approve a loan on a house with a bad septic.”

Who pays for septic system repairs: The buyer or the seller?

In most states, home sellers must pay for the cost of repairing the septic—or if it’s irreparable, you might be able to persuade the sellers to replace it entirely.

Agent Aaron Hendon of Christine & Company at Keller Williams in Seattle recently sold two properties with bad systems. In each case, the replacement cost was borne by the seller and the work completed before closing.

When replacing a septic may not be worth it

“If the leach field itself has failed, the entire septic system may need to be moved to a different location on the property,” says Maryland home inspector Welmoed Sisson.

In that case, a septic technician will survey the property for system requirements such as a location relative to any water sources. You’ll also have to get a soil evaluation, which runs about $1,500, according to Wise. Soil technicians will be looking at soil type and slope of the property.

Then a septic contractor will determine if the lot is large enough to accommodate a new drain field. Many existing systems are even with ground level, but new codes may no longer allow this and require unattractive remedies. So if there’s no place with appropriate soil to move the septic to, the homeowner may be forced to install what’s called a sand mound system (a literal mound of sand) or a holding tank system. The former is unsightly, and the latter could require monthly pump-outs.

Keep in mind, a failed system could also have contaminated the soil around its original location, so do soil tests for potential ground contamination at the old site.

Septic systems and home improvements

If you’re planning a large remodel in a home with a septic system, one thing to know is that any major improvements would require the owner to hook up to the public sewer system first (assuming it’s available, of course). In this case, the condition of the septic tank isn’t a factor as it will no longer be in use, says Gray.

The cost of connecting to the municipal sewer system falls to the buyer, and is far from cheap.

“We asked our septic company how much they thought it would cost to hook our previous home up to the sewer,” says Sisson. The answer: “Upward of $90,000.”

The one upside, of course, is that you can point this out to sellers and negotiate a great bargain. In other words, a bad septic system can always be turned to your advantage.