‹ Back to the blog

Buying & selling · · 18 min read

Selling a Rented Flat with a Tenant in Spain in 2026: Right of First Refusal (Tanteo y Retracto), Price and Options

Selling a flat with a tenant living in it is legal, but the tenancy continues and the tenant has priority to buy. Since 8 October 2026 a tenant can no longer agree to waive that right. We explain what the law says, how to notify the tenant, what options you have and how it all affects the price.

30 daysTime the tenant has to exercise the right of first refusal (tanteo) from formal notification (art. 25.2 LAU)
180 daysExpiry of the sale notification if the deed isn't signed before then (art. 25.2 LAU)
8/10/2026From this date, waiving the rights of first refusal and pre-emption can no longer be agreed (Royal Decree-law 29/2026, BOE)
5 or 7 yearsMinimum tenancy period the buyer must respect, depending on whether the seller is an individual or a company (art. 14 LAU)
70%Minimum price as a share of the valuation for purchases by large property holders until 2030 (Royal Decree-law 29/2026, Cuatrecasas, October 2026)
2 yearsExtraordinary extension the tenant can request if their contract ends before 31/12/2028 (Royal Decree-law 29/2026)

Selling a flat with a tenant living in it is perfectly legal in Spain, but it doesn't work the same way as selling an empty home. The tenancy agreement doesn't end with the sale, the tenant keeps their rights and, with some exceptions, has priority to buy before anyone else. What's more, since 8 October 2026 there has been an important change: a tenancy agreement can no longer include a clause in which the tenant waives that right.

In this guide we explain what the Ley de Arrendamientos Urbanos (LAU, Urban Leases Act) says when you want to sell a rented flat, how the tenant's derecho de tanteo y retracto (right of first refusal and right of pre-emption) works, how to notify the tenant correctly, what options you have and how they affect the price. We also look at what happens with the security deposit. It's written for private landlords in the Comunidad de Madrid (Madrid region), although the LAU rules apply throughout Spain.

Why many landlords are considering selling a rented flat in 2026

On 6 October 2026 the Consejo de Ministros (Council of Ministers) approved two housing royal decree-laws, published in the BOE (Official State Gazette) the following day: Royal Decree-law 28/2026, on the stability of tenancy agreements for habitual homes, and Royal Decree-law 29/2026, on urgent measures to protect the social function of housing. Both have to be ratified by the Diputación Permanente (Standing Committee) of Congress within 30 days, because parliament has been dissolved following the calling of elections. If a decree-law isn't ratified, it is repealed.

  • Royal Decree-law 29/2026: in force since 8 October 2026. Among other measures, it strengthens the tenant's preferential right to buy, allows tenants to request an extraordinary extension of up to two years for contracts ending before 31 December 2028, and until 2030 restricts purchases of homes below 70% of their market value by large property holders and by entities that buy properties or debt portfolios.
  • Royal Decree-law 28/2026: would come into force on 15 November 2026, only if ratified. It provides that, at the end of the minimum period, the contract is extended for equal periods unless notice is given, that the landlord must give at least six months' notice if they don't want to renew and that, in that case, they must pay compensation, with exceptions such as needing the home for themselves or close relatives.

In the preamble, the government states that the decree “extends and strengthens” the tenant's preferential right to buy. From the industry side, some affordable housing developers in Madrid have said the uncertainty has stalled projects. We don't assess the rules here; we only explain how they affect sellers. The details of the changes to renting are in “Small landlords and the new housing decrees”.

Selling doesn't end the tenancy: the buyer takes over the contract (article 14 of the LAU)

The basic rule is in article 14 of the LAU: whoever buys a rented home is subrogated, that is, takes the former owner's place with all their rights and obligations. This applies, at a minimum, for the first five years of the contract, or seven if the seller was a legal entity, even if the buyer meets the requirements of article 34 of the Ley Hipotecaria (Mortgage Act) (a good-faith buyer who registers their purchase at the Land Registry).

If the duration agreed in the contract is longer than those five or seven years, the buyer is bound for the entire agreed duration, unless protected by article 34 of the Mortgage Act. In that case they only have to respect the contract until five or seven years have passed, and it is the seller who must compensate the tenant with one month's current rent for each year remaining. That's why it's worth checking the agreed duration before putting the flat on the market.

In practice, almost nothing changes for the tenant, apart from the name of the person they pay:

  • The rent and how it is updated remain as set out in the contract, within the legal limits in force.
  • The duration and statutory extensions are maintained: the buyer cannot end the contract just because they have bought the property.
  • The security deposit and additional guarantees: the new owner will be the one who has to return them at the end of the tenancy.
  • Upkeep and repair obligations also pass to the buyer from the signing of the deed.

What the tenant's right of first refusal and pre-emption is (article 25 of the LAU)

Article 25 of the LAU gives the tenant a preferential right to buy when the home they rent is sold. It has two sides. Tanteo (right of first refusal) applies before the sale: the tenant can buy in preference, at the same price and on the same terms you are going to agree with a third party. Retracto (right of pre-emption or redemption) applies afterwards: if they weren't notified, were notified incorrectly or the property was sold on better terms than those communicated to them, they can step into the purchase and keep the home themselves.

RightWhen it's exercisedPeriodFrom when it counts
Tanteo (first refusal)Before the sale is signed30 calendar daysFrom formal notification of the decision to sell, the price and the essential terms
Expiry of the notificationIf the sale isn't completed180 calendar daysFrom the notification: after that period, notification must be given again
Retracto (pre-emption)After the sale, if there was no notification, a requirement was missing or the actual price or terms were more advantageous30 calendar daysFrom when the buyer formally notifies the tenant by giving them a copy of the deed or sale document
Priority over othersIf there are other acquisition rights over the home—It prevails over them, except the co-owner's pre-emption right and a contractual one registered before the tenancy agreement

Source: article 25 of Law 29/1994 on Urban Leases, text in force after Royal Decree-law 29/2026 (Iberley).

Two details that are often overlooked. If the home is sold together with other elements let as accessories, such as a garage or storage room, the tenant can't exercise their right over the home alone. And to register the sale at the Land Registry, you have to prove the notifications were made; if the home wasn't let, the seller must declare this in the deed.

How to notify the tenant of the sale, step by step

Most problems with the right of first refusal come from a badly made notification or from selling on terms different from those communicated. This is the logical order:

  1. Review the contract: signing date, agreed duration, extensions, whether it includes a clause waiving the right of first refusal and whether a garage or storage room is included.
  2. Set the essential terms before notifying: price, method of payment, deadlines and expected deed date. Ideally do this once you already have an interested buyer, so the terms are real.
  3. Send a formal notification, that is, one that leaves a record of the content and receipt: a burofax (certified letter) with text certification and acknowledgement of receipt, or a notarial notice. A WhatsApp message or a conversation isn't enough.
  4. Wait the 30 calendar days. If the tenant accepts, the sale is made to them on those terms. If they decline or don't reply, you can sell to the third party, but not on more favourable terms than those notified.
  5. If you lower the price or improve the terms, notify again. If 180 days pass without signing, the notification expires and must also be repeated.
  6. After the deed, the buyer must formally notify the tenant with a copy of the deed. From that moment the 30 days for the right of pre-emption begin.
  7. Keep all the proof: the notary and the Land Registry will ask you for it.

The Tribunal Supremo (Supreme Court) stressed this point in its judgment 127/2026 of 19 January. As reported by Economist & Jurist, the pre-emption period starts from the formal communication: a verbal mention of who the new owner is doesn't amount to full knowledge of the sale, and the fact that the purchase is recorded at the Land Registry doesn't replace the obligation to notify.

Waiving the right of first refusal: what has changed with Royal Decree-law 29/2026

For years, many tenancy agreements included a clause in which the tenant waived the preferential right to buy. It was a way of making a future sale easier. Royal Decree-law 29/2026 has closed that door: the new paragraph 8 of article 25 of the LAU is categorical.

The parties may not agree that the tenant waives the preferential right to buy.

Article 25.8 of the LAU, as worded by Royal Decree-law 29/2026

Some guides still say that the waiver is only valid in contracts of more than five years. That was what the LAU said in its original 1994 wording. Law 4/2013 removed that requirement and, until 7 October 2026, the waiver could be agreed in any contract, on one condition: the landlord had to notify the tenant of their intention to sell at least 30 days before signing the sale. This is how things stand depending on the date of the contract:

Contract signedWhat the law said about the waiverWhat to do
From 1 January 1995 to 5 June 2013Original LAU wording: the waiver was only valid in contracts with an agreed duration of more than five yearsCheck the agreed duration and the wording of the clause
From 6 June 2013 to 7 October 2026Law 4/2013: the waiver could be agreed in any contract, but notice of the sale had to be given 30 days before the deedAccording to the analyses consulted, the decree doesn't include a specific transitional rule on this point: have a lawyer review the clause and, if in doubt, notify the right of first refusal
From 8 October 2026Royal Decree-law 29/2026: the waiver cannot be agreedThe tenant will always have the rights of first refusal and pre-emption, except in the cases the law excludes

Source: Law 29/1994 in its original text (BOE of 25 November 1994, copy from the Comunidad de Madrid); adapted text from Notarios y Registradores; article 25 in force (Iberley); Cuatrecasas analysis of Royal Decree-law 29/2026 (October 2026).

If Royal Decree-law 29/2026 weren't ratified, it would be repealed and the previous wording would apply again. With this degree of uncertainty, the most prudent option for sellers is to notify the right of first refusal even if the contract contains a waiver clause. It costs little and prevents a sale that's already been signed from being exposed to a pre-emption claim.

Selling several flats or the whole building: what changes

Until now, the LAU excluded the rights of first refusal and pre-emption when the home was sold together with all the other homes and commercial premises the owner had in the building, or when the entire building was sold, even if the flats belonged to different owners. In 2025 the full Civil Chamber of the Supreme Court applied that rule to reject a pre-emption claim in a sale that included all the seller's homes in a building.

With Royal Decree-law 29/2026, the tenant's right no longer lapses just because their home is sold together with other homes, commercial premises or assets, provided it can be legally identified as a separate unit, as with a flat registered as an independent property. The price corresponding to each home is calculated using objective criteria, preferably the cadastral reference value or, failing that, an independent valuation, and the law declares ineffective any allocation of the price designed to obstruct the tenant's right. If you have several rented flats in the same building, this directly affects your sale.

Can the authorities buy first? Madrid, stressed areas and subsidised housing

The new paragraph 7 of article 25 adds another element: in joint sales, and subsidiarily to the tenant, housing legislation may grant a right of first refusal and pre-emption over the whole property to a body designated by the competent authority. It is an enabling provision: it only applies if a housing law develops it, and it is intended for sales of buildings or lots, not the sale of a single flat.

In the sources we have reviewed, we haven't found any Comunidad de Madrid rule giving the authorities a general right of first refusal on the sale of a rented flat on the open market. Nor has the Comunidad declared any zonas de mercado residencial tensionado (stressed residential market areas), as we explain in “Stressed areas in 2026”. Subsidised housing is a different matter: in transfers of such homes, the regional authorities usually have rights of first refusal and pre-emption and there may be price limits, with deadlines that depend on each region. If your flat has or had public protection status, check this first.

A clarification about another widely cited measure in the decree: the new IRPF (income tax) exemption for selling a home to a public body for social or affordable housing requires, among other conditions, that the home has been continuously empty without justified cause for the previous two years. So it isn't designed for a flat that has a tenant.

Option 1: sell to an investor with the tenancy in place

This is the most direct route. The investor isn't looking for a home to live in, but for rental income: they buy with the tenant in place and collect rent from the day of the deed. What matters most to them is the relationship between price and net rent, the time left on the contract and the tenant's payment history.

There are two preconditions. The first is notifying the tenant of the right of first refusal with the terms agreed with the investor. The second is coming to an understanding with the tenant about viewings: a cooperative tenant makes the sale much easier, and one who feels pressured can complicate it. Also bear in mind that, until 31 December 2030, large property holders and entities that buy properties or portfolios of non-performing loans cannot buy homes below 70% of their market value according to an approved valuation, with some exceptions.

Option 2: offer the flat to the tenant

Sometimes the best buyer already lives in the property. They know the home, the neighbourhood and the community of owners, and there's no need to organise viewings. You can raise the idea of a purchase informally before looking for other buyers; if you reach an agreement, the sale is formalised like any other, with arras (deposit contract) and deed.

The weak point is usually financing: many tenants haven't saved the deposit or don't have a pre-approved mortgage. And if the conversation goes nowhere and you sell to a third party, you'll have to formally notify them of the right of first refusal with the actual terms of that sale.

Option 3: wait for the tenancy to end

Selling the home empty opens up the whole market to you, including buyers looking for a home to live in, who are the majority. The problem is timing. On top of the minimum period of five or seven years comes the LAU's tacit extension, in yearly periods of up to three more years if nobody gives notice in time. And now there are two new factors:

  • Extraordinary extension under Royal Decree-law 29/2026: if the contract ends before 31 December 2028, a tenant who is up to date with payments can request yearly extensions of up to two years. The landlord must accept them unless other terms are agreed, they need the home for themselves or first-degree relatives, or a renewal or new contract is signed with a rent at least 5% lower. A sale isn't among those exceptions.
  • If Royal Decree-law 28/2026 is ratified: not renewing at the end of the minimum period would require six months' notice and payment of compensation, which according to Cuatrecasas's analysis is the higher of these two amounts: twelve months' rent or one month's rent for each year of the contract, with exceptions.

Waiting may make sense if the contract has only a few months left and doesn't meet the requirements for the extensions. If the period is long, time and regulatory uncertainty also have a cost.

Option 4: agree an early exit with the tenant

Landlord and tenant can agree to end the contract early, usually in exchange for financial compensation, months without paying rent or help with moving. The tenant is under no obligation to accept.

  • Put everything in writing: date for handing over the keys, amount and method of payment of the compensation, condition of the home and settlement of the deposit.
  • Make an inventory with photos on handover day, signed by both parties.
  • Don't make the sale conditional on an exit that hasn't been signed yet: if the tenant changes their mind, you'll be left with a commitment to sell that you can't fulfil.
  • Avoid any pressure: cutting off utilities, entering without permission or insisting in an intimidating way can have legal consequences and also destroys any chance of agreement.

Comparison table: which option suits you when selling a rented flat

OptionExpected priceTimescaleAdvantagesDisadvantages
Sell to an investor with the tenancyUsually lower than for an empty home; depends on the rent and remaining termThe time to find an investor, plus 30 days for the right of first refusalYou sell now and the buyer receives rent from day oneFewer potential buyers; compulsory right of first refusal; viewings depend on the tenant
Sell to the tenantNegotiable; can be close to market valueDepends on their financingSimple sale with no viewingsMany tenants don't have financing
Wait for the tenancy to endThat of an empty homeCan stretch to years because of statutory and extraordinary extensionsAccess to the whole marketRegulatory uncertainty; possible compensation if Royal Decree-law 28/2026 is ratified
Agree an exitThat of an empty home minus the agreed compensationHowever long the agreement takesAccess to the whole market without waitingDepends on the tenant's willingness; cost of the compensation

Our own analysis based on articles 10, 14 and 25 of the LAU and Royal Decree-laws 28/2026 and 29/2026. Indicative: each case depends on the specific contract.

What a rented flat is worth compared with an empty one

It's the most frequently asked question and there's no single answer. There's no official statistic measuring the discount on flats sold with a tenant, and the industry guides we have reviewed don't publish a figure with a clear methodology either. Be wary of round percentages with no source.

What is clear is how an investor calculates: they start from the annual rent, subtract the costs paid by the owner (IBI property tax, community fees, insurance, maintenance) and compare it with the net yield they're looking for. El blog del Euríbor, for example, considers a net yield of around 5% acceptable. An example with round figures, just to illustrate the method:

  • A flat that would sell for €400,000 empty is let for €1,500 a month, that is, €18,000 a year.
  • If the owner's costs add up to €3,000 a year, the net rent is €15,000.
  • An investor looking for a 5% net yield would pay about €300,000; one who would settle for 4% would go up to about €375,000.
  • If the contract has only a few months left and the tenant has no right to an extension, the investor will take into account that they can recover the value of an empty home, and the difference narrows.

So the difference depends above all on how close the rent is to market prices and how much time is left on the contract. Other factors that narrow or widen it are the tenant's payment history, whether viewings are possible, the condition of the home and, since October, the possibility of the tenant requesting the extraordinary extension. Before setting the price, ask for a valuation that takes the contract into account, not just the square metres and the area.

What happens to the security deposit when you sell with a tenant

According to article 36 of the LAU, for residential lettings the fianza (security deposit) is compulsory, paid in cash and equal to one month's rent. Additional guarantees can also be agreed, which in contracts of up to five years, or seven if the landlord is a legal entity, cannot exceed two months' rent. At the end of the contract, if the balance of the deposit isn't returned within one month of the keys being handed back, it accrues statutory interest.

Since the buyer takes over the landlord's obligations, they will be the one who has to return the deposit when the tenant leaves. That's why it's best to settle in the arras and the deed how it is transferred: usually the seller gives the buyer the amount of the deposit and additional guarantees, or it is deducted from the price. In the Comunidad de Madrid the deposit must be lodged with the regional government, so that deposit also needs dealing with; we explain it in “The rental deposit in 2026”.

Common mistakes when selling a flat with a tenant

  • Not notifying the right of first refusal, or doing so through a channel that leaves no record, such as a message or a call.
  • Notifying one price and then selling for less, or with more favourable payment terms, without notifying again.
  • Accepting a waiver clause at face value without checking the date of the contract and the rules in force.
  • Advertising the flat at the price of an empty home and then discovering it only interests investors.
  • Forgetting the deposit and additional guarantees when dividing things between seller and buyer.
  • Not allowing for the extraordinary extension the tenant can request if their contract ends before 2029.

Practices to watch out for when you're in a hurry to sell

Times of uncertainty encourage quick offers: unexplained discounts, commissions you only find out about at the end, last-minute costs or buyers whose ability to pay nobody has checked. It doesn't happen in every sale, but it's worth knowing how to spot it. Royal Decree-law 29/2026 itself aims the 70% restriction at those who buy properties or loan portfolios at a price clearly below their valuation.

  • Ask for an independent valuation that takes the tenancy agreement into account.
  • Insist on the total cost of the sale to you in writing: fees, taxes and costs.
  • Check the buyer's identity and that they really have the financing or funds before signing the arras.
  • Don't sign anything under pressure from artificial deadlines: the tenant's right of first refusal already means waiting 30 days.
General information, not advice This article summarises the Ley de Arrendamientos Urbanos and Royal Decree-laws 28/2026 and 29/2026 as of 13 October 2026. Both decrees are pending ratification and may change or be repealed. Every contract is different: before selling a rented flat, consult a lawyer or your notary about the validity of the clauses, the deadlines and the tax treatment of the sale. We explain the costs and tax treatment of the sale in “How to sell a flat in Madrid in 2026”.

How we do it at Llavely

With Llavely you can also sell your rented flat in the Comunidad de Madrid. We look for buyers for a home with a tenant, such as investors who are looking for exactly that, we talk to each one before showing it and check their ID, and we carry out the viewings ourselves, coordinating them with the tenant. You only pay if you sell, on the day of the notary signing.

If you'd rather not worry about the rights of first refusal and pre-emption, with Llavely you have specialised lawyers from start to finish, included in the 2.5% + VAT you pay only if you sell: they prepare and send the notification to the tenant, keep track of the deadlines, set out in the arras and the deed the buyer's takeover of the tenancy and the transfer of the deposit, review charges and the nota simple (land registry extract), calculate the plusvalía (municipal capital gains tax) and IRPF and come with you in person to the notary on signing day. You also get buyers screened and verified by us, valuation, photos and virtual tour, management of offers and the arras, anti-money-laundering checks, coordination with the notary and your private seller portal to follow everything.

Either way, what you see is what you get: no extra payments or hidden costs, and real people reviewing every step. If you're thinking of selling a flat with a tenant in the Comunidad de Madrid, ask for your free valuation: we get back to you within 24 hours (we reply in English by email, message or phone), see the property and give you the price.

Frequently asked questions

Can I sell my flat if there's a tenant living in it?

Yes. The law doesn't require the home to be empty in order to sell it. The buyer takes over the contract and the tenant keeps their rights, so you'll have to respect the tenancy and notify them of their right of first refusal before selling.

Can the new owner evict the tenant?

Not just because they've bought the property. Under article 14 of the LAU, the buyer must respect the contract for at least the first five years, or seven if the seller was a legal entity, and in many cases for the entire agreed duration. At the end, the same extension rules apply as for the previous owner.

How long does the tenant have to exercise the right of first refusal?

Thirty calendar days from receiving formal notification of the decision to sell, with the price and essential terms. If the sale isn't signed within 180 days of that notification, notification must be given again.

What happens if I sell the flat without telling the tenant?

The tenant can exercise the right of pre-emption and take the home for the same price and on the same terms. They have 30 calendar days from when the buyer formally notifies them of the sale with a copy of the deed. In addition, the Land Registry requires proof of the notifications to register the purchase.

Is the waiver of the right of first refusal my tenant signed still valid?

It depends on the date of the contract. Since 8 October 2026 the waiver cannot be agreed. In contracts signed between June 2013 and 7 October 2026 the law allowed it, with notice of the sale 30 days before the deed; the analyses consulted don't mention a specific transitional rule, so it's best to have a lawyer review the clause and, if in doubt, notify the right of first refusal.

Can I notify the tenant of the sale by WhatsApp or email?

The law requires formal notification that leaves a record of the content and receipt. The usual method is a burofax with text certification and acknowledgement of receipt, or a notarial notice. The Supreme Court has pointed out that a verbal communication isn't equivalent to notification.

How much less is a rented flat worth than an empty one?

There's no official figure. The price an investor pays depends on the net rent the flat generates and the yield they're looking for, as well as the time left on the contract. The lower the rent compared with the market and the longer the contract, the bigger the difference from the price of an empty home.

Who returns the deposit if I sell the rented flat?

The buyer, because they take over the landlord's obligations. That's why the seller usually gives them the amount of the deposit and additional guarantees, or it's deducted from the price, and this should be set out in the arras and the deed. In Madrid you also need to deal with the deposit lodged with the regional government.

Do I have to compensate the tenant if I sell?

The sale alone doesn't give rise to compensation. There is one case provided for in article 14 of the LAU: if the contract had an agreed duration of more than five or seven years and the buyer is protected by article 34 of the Mortgage Act, the seller must pay the tenant one month's rent for each year remaining. Separately, if Royal Decree-law 28/2026 is ratified, not renewing at the end of the minimum period may give rise to compensation.

Does the Comunidad de Madrid have a right of first refusal over my rented flat?

In the sources reviewed, we haven't found a Madrid rule giving the authorities a general right of first refusal on the sale of an open-market flat. The LAU allows housing legislation to provide for it in joint sales of buildings, subsidiarily to the tenant. If the home is subsidised housing, there may indeed be rights for the authorities and price limits.

Sources

  1. Article 25 of the Ley de Arrendamientos Urbanos (Urban Leases Act), text in force after Royal Decree-law 29/2026 (Iberley, October 2026)
  2. Real Decreto-ley 29/2026, de 6 de octubre, on urgent measures to protect the social function of housing, consolidated text (BOE, Official State Gazette, October 2026)
  3. Legal Flash: new developments for the real estate sector, Royal Decree-laws 28/2026 and 29/2026 (Cuatrecasas, 7 October 2026)
  4. New developments for the real estate sector (Cuatrecasas, 7 October 2026)
  5. Urgent measures to protect the social function of housing (La Administración al Día, INAP, October 2026)
  6. Ley de Arrendamientos Urbanos, adapted text (Notarios y Registradores)
  7. Ley 29/1994, de 24 de noviembre, de Arrendamientos Urbanos (Urban Leases Act), original text from the BOE of 25 November 1994 (Comunidad de Madrid)
  8. The tenant's deadline to match the offer when the owner sells the home (El Español, 8 May 2026)
  9. Preferential acquisition rights: what they are and how they work for a home (Tinsa, June 2026)
  10. Tenancies: the Supreme Court clarifies how to calculate the period for exercising pre-emption (Economist & Jurist, 20 February 2026)
  11. The Supreme Court rules on the urban tenant's right of pre-emption in a joint sale (LegalToday, 25 April 2025)
  12. What the Diputación Permanente (Standing Committee) is and what happens to the housing decrees (Maldita, 7 October 2026)
  13. Uncertainty over the government's decrees halts construction of 800 affordable rental homes in Madrid (Artículo 14, 6 October 2026)
  14. Right of first refusal and pre-emption: what it is, deadlines and how to exercise it in 2026 (Gibobs, 25 May 2026)
  15. Selling a flat with a tenant: three questions answered (El blog del Euríbor, 23 March 2023)

Sell to people who can already buy.

Listing is free. 2.5% + VAT only if you sell, no hidden costs.