When signing a lease for an apartment or home, most people plan to stay there for the duration of their agreement with their landlord. But sometimes, life happens.

Leaving before your lease expires is known as “breaking a lease,” and it’s something that happens for all types of reasons — like buying your own home, having to move away for a job opportunity, or finding yourself in a difficult financial situation. Breaking a lease can be complicated, and can leave you on the hook for a lot of money.

“It’s not that a landlord can stop a tenant from moving out. The landlord is not going to lock the door and keep the tenant barricaded in there,” says Rachel Garland, managing attorney of Community Legal Services of Philadelphia’s housing unit. “Breaking a lease is about the ongoing financial responsibility of the tenant.”

But what happens if you don’t have a choice, and you need to get out of your lease early? Here is what you need to know:

Read your lease

If you think you need to break your lease, the first thing to do, Garland says, is to read through your rental agreement with your landlord to get a few important pieces of information.

Chief among them is how long your lease is actually for — it may be a year, or longer, or it may be month-to-month. If your lease term is coming to an end, or if you are on a month-to-month lease, you may be able to avoid breaking the lease. Your lease will tell you how much notice you have to give your landlord if you are deciding not to renew your lease, which is typically 30 or 60 days.

Your lease may also have an early termination clause, which outlines how much you have to pay if you move out before the lease term ends. Those penalties can vary. Some agreements might say that you will forfeit your security deposit and pay a few months’ rent. Or, your landlord can try to hold you responsible for rent through the end of the lease term.

“As a tenant, you have to weigh the pros and cons of breaking the lease,” Garland says. “The pro is that if you really need to move, you break the lease and you move. The con is that there could be financial consequences.”

Does my landlord need to re-rent my unit?

If your landlord can’t rent your apartment after you leave, you may be on the hook for rent for the rest of your lease. But if they do find another tenant, they can’t charge you rent for the place, too.

But does your landlord have to look for another tenant? In many states, residential landlords are required to make reasonable efforts to re-rent their properties when a tenant breaks a lease, as opposed to charging you for the remaining rent on the lease term. This is called a “duty to mitigate damages.”

Pennsylvania’s laws regarding mitigation of damages are less clear, but Garland says that residential landlords in the commonwealth have “an obligation to try to re-rent the unit” if a tenant breaks a lease, and cannot simply “ride out the lease term and say, ‘You owe me all this money.’”

While there is conflicting information online about this, Garland says that essentially residential landlords have to try to find a tenant, but landlords for commercial spaces do not.

Still, you could have to pay if your landlord can’t find a new tenant. “The landlord can say that they legitimately tried to do all that and have not been able to re-rent the unit,” Garland says. “Then, they can charge that money to the tenant.”

When can you legally break a lease?

There are situations in which you may be able to move out before your lease is up without penalty in Pennsylvania. Most of them, Garland says, come down to a landlord having “done something to break the lease themselves,” such as refusing to fix serious issues with your apartment, like a broken furnace during winter.

There are other exceptions, too. If you’re an active military service member, federal law allows you to terminate your lease early if necessary.

Philadelphia also has protections if you’re a victim of domestic violence or sexual assault and you need to end your lease early to stay safe. According to the Fair Housing Commission’s website, if you’re in that situation, you “can terminate [your] lease at any time without penalty.” For help, Garland recommends contacting the Philly Tenant Hotline at 267-443-2500.

There are few other reasons that you can get out of a lease without penalty in Pennsylvania. So if you buy a house, move in with a partner, or have to relocate for work or school, you probably don’t have legal protection that will let you out of your lease.

One important note: There are, currently, no protections in place that allow tenants to break their lease due to the impacts of the coronavirus pandemic (though some rental assistance programs are available).

“There aren’t really any protections that will help support tenants who need to get out of their leases for financial reasons right now,” Garland says.

Talk to your landlord

OK, but what happens if you have to break your lease anyway? Garland says that the best route is to keep lines of communication open with your landlord.

“It never hurts for them to reach out to their landlord and explain the circumstances,” Garlands says. “Some landlords understand, and would rather exit a possibly disastrous financial situation sooner rather than later.”

Keep records of all official communication, such as by sending letters via certified mail. That way, you may be able to negotiate a documented agreement, like being let out of your lease for an agreed-upon price, by finding someone to sublet your unit, or even — in a best-case scenario — without penalty.

Some landlords, she adds, may be more willing to let a tenant out of a lease now, during summer, because it’s generally easier to find a new tenant in summer than it is in winter.

You can also help by collecting a list of people who are interested in renting the property and giving it to your landlord. Whatever you do, though, it is important to be cooperative and give the process plenty of time.

“The more notice the tenant can give the landlord, and the more the tenant can cooperate with the landlord in terms of re-renting the unit, the better it will be for the tenant,” Garland says. “It’s always better to try and come to some type of agreement in advance.”