Boundary and party walls in Spain: the lindero and medianería explained
Shared walls and fences between neighbours are governed by a short section of the Spanish Civil Code. Knowing its basic rules makes it far easier to agree a new fence – or replace an old one.
What do lindero and medianería mean?
In short: the lindero is the dividing line between two properties; medianería is the legal situation in which a wall, fence or hedge on that line is shared by both owners.
Two Spanish words come up in every boundary conversation. The lindero is the boundary line itself, as defined by deeds and, in practice, by the cadastral plan and what is marked on the ground. Medianería is the shared ownership regime that applies to a wall, fence, hedge or ditch that divides two properties and belongs to both.
The Spanish Civil Code deals with medianería as a type of easement (servidumbre) in articles 571 to 579. The text is available in the consolidated version of the Code published by the BOE, linked below. This guide summarises those articles in plain English; it is not legal advice, and for a specific dispute you should speak to a Spanish lawyer.
Before any of these rules matter, the line itself must be clear. Our page on boundary fences with neighbours covers the practical side of agreeing it.
When is a wall or fence presumed to be shared?
In short: the Civil Code presumes medianería in certain dividing walls and rural fences unless a title, an exterior sign or other proof shows otherwise.
Article 572 of the Civil Code presumes the existence of medianería, as long as there is no title, exterior sign or proof to the contrary, in three situations:
- dividing walls between adjoining buildings, up to the common point of height;
- dividing walls of gardens or yards, whether in a town or in the countryside;
- fences, enclosures and live hedges that divide rural plots (predios rústicos).
Article 573 then lists exterior signs that point against a shared wall, and article 574 extends the presumption to ditches and channels between plots. In practice, deeds, old agreements and how the wall was built all count as evidence.
The practical lesson: do not assume an old wall or fence is yours alone, or entirely your neighbour's. Check the deeds and talk before demolishing or altering anything on the line.
Who pays to repair or rebuild a shared wall or fence?
In short: under the Civil Code, all owners who share the medianería pay for repair and construction in proportion to their right – unless one renounces it.
Article 575 sets the basic rule: the repair and construction of party walls and the maintenance of shared fences, hedges, ditches and channels are paid by all owners who have the medianería in their favour, in proportion to each one's right.
The same article allows an owner to avoid contributing by renouncing the medianería, except where the party wall supports a building of theirs. Renouncing has consequences for ownership of the wall, so take advice before doing it.
For a new fence, most neighbours simply agree a split in writing. When both owners receive the same itemised quote, the shares are easy to calculate. Our how we work page explains how we prepare quotes for shared projects.
Can one owner raise or use a party wall?
In short: the Code allows an owner to raise a party wall at their own expense and to use it in proportion to their share – but planning rules still apply.
Article 577 states that any owner may raise the party wall, doing so at their own expense, with further obligations set out in that article. Article 578 deals with the position of the other owners who did not contribute to the extra height, depth or thickness, and article 579 allows each owner to use the party wall in proportion to their right in the shared ownership.
Civil law is only half the picture. Raising a wall is building work that needs to fit the town's height and opacity limits and may need authorisation; see our fence height guide and permit guide. And structurally, an old wall may not carry extra height without a new foundation. Before raising any shared wall, we check its base and condition.

Can you avoid all this by building on your own side?
In short: yes – a fence built entirely inside your land is yours, and the medianería rules for shared walls do not govern it in the same way.
Many owners choose to build their new fence fully within their own property, a little back from the line. Article 388 of the Civil Code recognises an owner's right to enclose their land, without prejudice to existing easements. A fence on your own side means you decide its type and finish within planning and community rules, you pay for it alone and you maintain it alone.
The cost is a strip of land and, sometimes, an awkward gap between your new fence and an old one on the line. Agree with your neighbour what happens to the old fence. If you choose this route, see fence on a low wall and the fence types overview for options.
Official sources
Articles and guides

Boundary fence with neighbours: agreeing the line and building it
A fence between two homes is part building job, part agreement. We build it; you and your neighbour decide where it goes, who pays and what it looks like – ideally in writing.
View details →Fence permits in Spain: what Andalusian owners need to know
Building a fence in Málaga province is a building act, and the town hall controls it. This guide explains the framework, the two main routes and the questions to ask before you build.
View details →Fence height rules: how high can your fence be in Málaga province?
There is no single national fence height in Spain. Each town sets its own limits, often with separate rules for the solid part and the open part of a fence – and urbanisations can add more.
View details →
What owners wish they had known before building a fence in Spain
These are the practical points owners most often raise once a fence project is under way – collected as advice, so you can deal with them before you start.
View details →Frequently asked questions
What is a medianería?
The shared ownership regime of a wall, fence, hedge or ditch that divides two properties. The Civil Code regulates it in articles 571 to 579.
How do I know if the wall between us is shared?
Check the deeds and any agreements. The Civil Code presumes sharing in certain dividing walls and rural fences unless a title, exterior sign or other proof says otherwise.
Does my neighbour have to contribute to repairs?
Under article 575, owners who share the medianería contribute in proportion to their right, unless one renounces it where allowed. For disputes, ask a lawyer.
Can I knock down a shared wall?
Not unilaterally. It is jointly owned. Agree with your neighbour and check planning rules first.
Can I make the shared wall higher?
Article 577 allows an owner to raise it at their own expense, with conditions. Town planning limits and authorisation still apply, and the wall must be structurally able to take it.
Can I fix things to my side of a shared wall?
Article 579 allows use in proportion to your right. Heavy fixings or structural changes should be agreed with your neighbour.
What is the lindero?
The boundary line between two properties, defined by deeds and usually reflected in the cadastral plan.
What if the cadastral plan and the deeds disagree?
Have a surveyor measure the line. Correcting records is an administrative and possibly legal process; do not fence a disputed line.
Does the Civil Code set fence heights?
No. Heights are planning matters set by each town. The Civil Code governs ownership and costs between neighbours.
Can you build a shared fence with two owners paying?
Yes, once both owners agree the line, the fence and the split. We provide one itemised quote both can read.
Is this legal advice?
No. This guide summarises the Civil Code for general information. For a specific case, consult a Spanish lawyer.
Send photos – get an itemised fence quote
Send photos and the approximate length of your fence line. We reply with questions or a visit, then an itemised quote with no commitment. Owners abroad welcome.