Can a Landlord Change the Locks in Spain? What is Legal
The rental market in Spain constantly generates doubts and friction between landlords and tenants, with access to the property being one of the most conflict-prone areas. One of the most recurring questions that generates the most tension in situations of non-payment or disagreement is: can a landlord change the locks of a rented property? The short and resounding answer is no, under no unilateral circumstances, even if the tenant does not pay the rent. Below, we analyze in depth the Spanish legal framework, the serious criminal consequences for a landlord who takes the law into their own hands, and the legal mechanisms that actually exist to resolve rental disputes.
The Legal Framework: Why is it illegal for a landlord to change the locks?
Under Spanish law, the home is inviolable. Once a lease agreement is signed and the keys are handed over, possession of the property is transferred to the tenant. This means that, even if the landlord retains registered ownership of the flat, they lose the right to use and enjoy it for the duration of the contract.
Spanish legislation fiercely protects the tenant's possession and dwelling through several statutory texts:
1. The Spanish Constitution (CE)
Article 18.2 of the Constitución Española (Spanish Constitution) establishes that "the home is inviolable. No entry or search may be made in it without the consent of the owner or a judicial resolution". From the moment the tenant moves into the flat, it becomes their constitutional home, which is protected even against the owner themselves.
2. The Urban Leasing Act (LAU)
The Ley 29/1994, de 24 de noviembre, de Arrendamientos Urbanos (the Ley de Arrendamientos Urbanos or LAU / Urban Leasing Act) regulates the rights and duties of both parties. Article 21.1 of the LAU imposes an obligation on the landlord to carry out all necessary repairs to maintain the property in habitable conditions for its agreed use. Preventing access by changing the locks is a direct violation of this obligation to guarantee the peaceful use of the property.
3. The Civil Code (CC)
Article 1554.3 of the Código Civil (Civil Code) obliges the landlord "to maintain the tenant in the peaceful enjoyment of the lease for the entire duration of the contract". Changing the locks unilaterally and violently breaks this peaceful enjoyment.
4. The Criminal Code (CP): Criminal consequences for the landlord
This is the most critical point for property owners. Changing the locks without the tenant's consent or without a judicial eviction order is not a simple civil infraction; it is a crime. The owner could face:
- Crime of coercion (Article 172 of the Criminal Code): This punishes anyone who, without being legitimately authorized, prevents another with violence from doing what the law does not prohibit, or compels them to do what they do not want to do. Prison sentences can range from 6 months to 3 years or a fine of 12 to 24 months, depending on the severity.
- Crime of trespassing (Article 202 of the Criminal Code): A private individual who, without living in it, enters another person's dwelling or remains in it against the will of its inhabitant, shall be punished with a prison sentence of 6 months to 2 years. If this is also carried out with violence or intimidation, the prison sentences rise to 1 to 4 years and a fine of 6 to 12 months.
What happens in case of non-payment? The Housing Law and the LEC
There is a false belief that if the tenant does not pay the rent, the contract is automatically terminated and the landlord can reclaim their flat. This is a serious mistake.
The Ley 12/2023, de 24 de mayo, por el derecho a la vivienda (Housing Law), together with the Ley de Enjuiciamiento Civil (the Ley de Enjuiciamiento Civil or LEC / Civil Procedure Act), regulate eviction processes. The non-payment of rent entitles the landlord to request the termination of the contract (according to Article 27.2.a of the LAU), but this termination must be declared by a judge.
Until a court issues an eviction ruling and executes the corresponding lanzamiento (eviction/official lockout with a judicial commission), the tenant remains the legitimate possessor of the property, even if they are a defaulting tenant.
Practical Examples: Economic and Criminal Consequences
To understand the seriousness of acting outside the law, we analyze two realistic scenarios in the Spanish rental market.
Example 1: The landlord who changes the locks due to non-payment (Criminal Route)
- Situation: Carlos rents a flat in Madrid to Lucía for 950 € per month. Lucía stops paying the rent for 3 months, accumulating a debt of 2,850 €. Frustrated, Carlos takes advantage of the fact that Lucía is at work, calls a locksmith (whose service costs 150 €), and changes the locks. In addition, he packs up Lucía's things and leaves them in the building's main entrance.
- Result: Lucía calls the national police, who verify that this is her habitual residence (using the rental contract and utility bills). Lucía files a criminal complaint for coercion and trespassing.
- Consequences for the landlord: The criminal court convicts Carlos as the perpetrator of a crime of coercion. He is sentenced to an 8-month fine with a daily quota of 10 € (a total fine of 2,400 €), in addition to the obligation to compensate Lucía with 1,500 € for moral damages and temporary accommodation costs. Carlos ends up with a criminal record, still has not collected the 2,850 € debt (which he must claim in a separate civil process), and Lucía is reinstated in the property by court order.
Example 2: The correct legal procedure (Civil Route)
- Situation: Mateo rents an apartment in Valencia to John (a foreign resident) for 800 € per month. John loses his job and stops paying the rent. Mateo, advised by a lawyer, decides not to take the law into his own hands.
- Result: Mateo files an eviction lawsuit for non-payment of rent (a procedure regulated in Article 250.1.1º of the LEC).
- Deadlines and amounts: The cost of the lawyer and procurador (court representative) amounts to about 900 €. The judicial process takes 7 months. Finally, the court decrees the lanzamiento. John is legally evicted by the judicial commission. Mateo recovers his property in a 100% legal manner. Although he has assumed the legal costs and has missed out on 5,600 € in rent (which the judge orders John to pay, though it may be difficult to seize if he is insolvent), Mateo has his property back, with no criminal record and no fines to pay.
Practical Step-by-Step Procedures in Case of Conflict
If you are a landlord and your tenant is not paying, or if you are a tenant and your landlord is threatening to change the locks, these are the action protocols you should follow.
If you are a LANDLORD and face non-payment:
- Formal amicable demand: Send a burofax (certified mail with proof of delivery and content certification) to the tenant claiming the amounts owed. Grant a period of 10 days for payment. This serves to establish a legal record and prevent the enervación (the tenant's right to stop the eviction by paying the debt at the last minute) later on.
- Consult a specialist lawyer: If there is no response or payment within the indicated period, go to a lawyer to draft the eviction lawsuit for non-payment of rent and claim of debt.
- Filing the lawsuit: The lawsuit is filed in the courts of the place where the property is located, requiring the intervention of a procurador and a lawyer (mandatory if the annual rent or amount claimed exceeds 2,000 €).
- Await the admission decree and eviction date: The court will notify the tenant, giving them 10 days to vacate, pay (if enervación is possible), or file an opposition. The eviction date will be set in the same document.
- *Execution of the eviction (lanzamiento):* On the designated day, the judicial commission (together with a locksmith hired by the landlord) will go to the property to legally take possession of the premises.
If you are a TENANT and the landlord has changed your locks:
- Do not try to force the door: Do not try to enter by force, as the landlord could report you for damage or trespassing if they have re-occupied the property.
- Immediately call the Police or Civil Guard: Explain that the owner has changed the locks of your habitual home. Show the officers your rental contract, recent rent receipts, or your empadronamiento (town-hall registration certificate). The officers will write a police report (atestado) which will be crucial for the trial.
- *File a complaint at the duty court (juzgado de guardia): Go with the police report and proof that you resided there to report the owner for a crime of coercion and/or trespassing. Request the immediate restoration of possession (that the keys be returned to you immediately) as an urgent precautionary measure (medida cautelarísima*).
- Claim damages: Keep all receipts for hotels, restaurants, or furniture storage facilities that you have had to pay for due to being unable to access your home, in order to claim them financially from the landlord in the criminal or civil proceedings.
Mistakes You Must Avoid
Committing any of these errors can transform a landlord from a victim of non-payment into a defendant in a criminal court:
- Cutting off utility services (water, electricity, or gas): Just like changing the locks, cutting off electricity or water to "pressure" a defaulting tenant is classified as a crime of coercion. The landlord must continue paying for utilities if they are in their name and then claim that amount judicially.
- Entering the property "to see how it is": Even if the flat belongs to you, you cannot enter without the express consent of the tenant. Doing so constitutes a crime of trespassing, which carries prison sentences.
- Accepting a verbal agreement to hand over the keys without signing anything: If the tenant agrees to leave voluntarily, it is vital to sign a Documento de resolución de contrato de mutuo acuerdo y entrega de llaves (termination of contract by mutual agreement and key handover document). If it is not signed, the tenant could criminally report the landlord, claiming they entered without permission and stole belongings.
- Threatening the tenant via messaging channels: Sending WhatsApp messages or emails with a threatening tone ("if you don't pay I'll throw you out", "I'm going to come with some friends to take your things out") will serve as perfect prosecution evidence in a trial for coercion against the landlord.
Frequently Asked Questions (FAQ)
What happens if the rental contract has already expired and the tenant does not leave?
Even if the lease agreement has ended (for example, due to the expiration of the mandatory extension period) and the tenant refuses to leave the property, the landlord still cannot change the locks. The tenant enters a state of tácita reconducción (implied renewal) or occupation without title, but their physical possession remains protected. The landlord must go through the civil route by filing an eviction lawsuit for expiration of the contractual term.
If the tenant authorizes me in writing in the contract to change the locks in case of non-payment, is it legal to do so?
No, that clause is null and void. Article 6 of the LAU establishes that clauses that modify the rules of the law to the detriment of the tenant are null, unless the rule itself authorizes it. Furthermore, fundamental rights (such as the inviolability of the home in Article 18.2 CE) are non-disposable and cannot be waived by private contract.
Can I change the locks if the tenant has been missing for months and the flat seems empty?
This is not recommended either. If the tenant has stopped paying but has not handed over the keys or signed the termination, they legally remain in possession of the property. If the landlord enters and changes the locks, and the tenant reappears claiming they were traveling or in the hospital, the landlord could be reported for trespassing. The only safe way is to file an eviction lawsuit and have the court officially declare the abandonment of the property.
If I am a tenant and the landlord has changed the locks, can I call a locksmith to get back in?
If you have a valid rental contract and can prove it is your home, you have the right to access your residence. However, to avoid physical conflict or cross-complaints for damage, the ideal approach is to carry out this action in the presence of the State Security Forces and Bodies (National Police or Civil Guard) so they can attest to the situation and you avoid accusations of using force on property.
In Summary
- Absolute prohibition: Under no circumstances can a landlord change the locks of a rented property without the tenant's consent or a judicial eviction order.
- Serious criminal consequences: Acting unilaterally constitutes a crime of coercion and/or trespassing, with penalties that include imprisonment for up to 3 years and heavy financial fines.
- Non-payment does not justify force: Even if the tenant owes monthly rent payments, their constitutional right to the inviolability of the home remains intact until a judge rules otherwise.
- Utility cut-offs are prohibited: Cutting off electricity, water, or gas to force the tenant out is criminally punished in the same way as changing the locks.
- The only legal route is judicial: The landlord must initiate a civil eviction procedure for non-payment of rent or expiration of the contractual term, as regulated by the Ley de Enjuiciamiento Civil.
General legal information, not personalised legal advice. For your specific situation, ask your question for free at AbogadoAI — answers grounded in Spanish law (BOE), in English.
Have a specific legal question?
Ask AbogadoAI and get an answer based on Spanish law (BOE), with sources — in English.
Ask for freeThis is general information, not legal advice. Verify on the BOE or consult a lawyer for your specific case.