Entering someone's home without their consent is a criminal offence in Spain, set out in the Criminal Code as allanamiento de morada. It carries a prison sentence even when nothing is stolen and nobody is hurt, because the interest it protects is not property but privacy.
This article explains what the law requires for a conviction, the penalties that apply, and the defences that work in practice.
What the Criminal Code punishes
Article 202.1 punishes any private individual who enters another person's dwelling, or stays there against the will of the occupant.
The offence protects the inviolability of the home guaranteed by Article 18.2 of the Spanish Constitution. That distinction matters in practice. The prosecution does not need to prove theft, damage or injury. Entry alone, without valid consent, completes the offence.
The two ways it is committed
- Entering the dwelling without the occupant's consent.
- Remaining inside after the occupant has made clear they want the person to leave.
The second form catches situations where entry was lawful at the start. A guest who is asked to leave and refuses can commit the offence even though no door was forced.
Penalties for unlawful entry
The basic penalty under Article 202.1 is a prison sentence of six months to two years.
Where the entry or the stay involves violence or intimidation, Article 202.2 raises this to one to four years in prison together with a fine.
Article 203 covers a related situation, entry into the premises, offices or establishments of a legal person outside opening hours. The penalties there are lower than for a private dwelling, which reflects the weaker privacy interest at stake.
Article 204 applies where the person entering is a public authority or official acting without legal cause. The penalty is then imposed in its upper half, together with a long period of absolute disqualification from public office.
What counts as a dwelling
Spanish case law reads the concept broadly. What matters is whether the space is where a person's private life actually takes place, not who holds the title deeds.
Courts have treated the following as dwellings.
- Habitual residences and second homes.
- Rented properties, including where the tenant is behind on rent.
- Hotel rooms for the duration of the stay.
- Caravans and boats used as living space.
Spaces without that privacy function usually fall outside Article 202. Shared stairwells, communal garages and commercial premises open to the public are ordinarily dealt with elsewhere in the Code.
Unlawful entry is not the same as squatting
These two offences are frequently confused, including in press coverage.
Unlawful entry requires the property to be someone's actual dwelling at the time. Occupying a property that is not currently anyone's home, typically an empty or abandoned building, falls under Article 245 instead.
The practical consequences differ considerably, both in the penalty and in the speed of the remedies available to the owner. Getting the classification right at the outset shapes the whole case.
Defences that work in practice
- Consent. Consent can be express or inferred from conduct. Where it existed at the point of entry, the first form of the offence falls away.
- The space is not a dwelling. If the property was not being used as a home, Article 202 does not apply.
- Mistake. A genuine and reasonable belief that entry was permitted can exclude criminal intent.
- Necessity. Entering to prevent a greater harm, such as responding to a fire or a medical emergency, can justify the conduct.
- Lawful authority. Entry with a judicial warrant, or in the limited circumstances the law allows without one, is not an offence.
Key points
- The offence protects privacy rather than property, so no theft or damage is required.
- The basic penalty is six months to two years, rising to one to four years where there is violence or intimidation.
- Refusing to leave when asked can complete the offence even after lawful entry.
- A dwelling is defined by its function as private living space, not by ownership.
- Occupying an empty property falls under Article 245, a different offence with different consequences.
If you are under investigation, or someone has entered your home unlawfully, the classification of the property and the question of consent will usually decide the outcome. Both need to be addressed early.
Speak to our criminal defence team for an assessment of your case. You may also want to read our guide on your rights when arrested in Spain.

