Photo by Abishanth Ahilan on Unsplash
Guides

Illegal Builds and Land Checks on the Costa del Sol: AFO, First-Occupation Licences and Buyer Safety in 2026

How to check for illegal builds and AFO status when buying Costa del Sol property: land registry, first-occupation licences and urbanistic checks.

Illegal Builds and Land Checks on the Costa del Sol: AFO, First-Occupation Licences and Buyer Safety in 2026

A property on the Costa del Sol can be physically complete, lived in, and openly marketed for years, yet legally irregular because it was built without a planning licence or on land where construction is prohibited. The Junta de Andalucia’s own 2019 decree identified roughly 300,000 irregular buildings on non-urbanisable land across the region. The right due-diligence searches catch this before you commit a euro, and the checks differ materially from what an agent or a seller will volunteer.

What counts as an illegal build in Andalusia?

An illegal build is any structure erected without the required municipal planning licence (licencia de obras) or in breach of its conditions, on land where the urbanistic classification does not permit construction. The legal framework is the Ley 7/2002 de Ordenacion Urbanistica de Andalucia (LOUA), which classifies land as urban, urbanisable, and non-urbanisable, and sets the licence regime for each.

The scale is documented by the Junta de Andalucia itself. The Decreto-ley 3/2019, which introduced a framework for regularising irregular buildings, states that of approximately 500,000 buildings existing on non-urbanisable land in Andalusia, around 300,000 are irregular, having been constructed without the preceptivas licencias urbanisticas. That decree was convalidated by the Andalusian Parliament with cross-party support. The risk is not theoretical: it is a documented structural feature of the Andalusian rural property market.

If you are buying a country villa in the hills above Mijas, Ojen, Benahavis or Istan, this is the single most important check your lawyer must run. If you are buying an apartment in a consolidated urbanisation with a registered title and a first-occupation licence, the risk is far lower but not zero, because extensions, pools, or outbuildings may have been added without permission.

What does AFO status actually mean for a buyer?

AFO stands for asimilado a fuera de ordenacion, meaning “assimilated to out of order.” The Junta de Andalucia defines it precisely: it applies to a completed building constructed without the required licences, or in breach of their conditions, where enforcement of urban legality is no longer possible because the statutory restoration period has expired.

What AFO does, according to the Junta’s own guidance: it allows the building to connect to basic services (water, sanitation, electricity) where infrastructure exists, permits essential maintenance works for safety and habitability, and enables registration in the Property Registry.

What AFO does not do: it does not legalise the building. The Junta states this unambiguously. The property remains technically irregular. You cannot extend it, add a pool, or carry out improvements beyond what is strictly necessary to maintain safety and habitability. If the town hall later revises its urbanistic plan and the land is reclassified, the AFO status may be revisited.

For a buyer, AFO is a warning label, not a clean bill of health. It means the property is tolerated, not compliant, and you are buying that tolerance along with the house.

Which due-diligence checks catch illegal builds before you commit?

Your independent lawyer should run the following searches before you pay any deposit or sign an arras contract. For guidance on why an independent lawyer matters, see our guide on whether you need a lawyer to buy property in Spain.

CheckWhat it verifiesIssued byRisk if missing
Nota simpleOwnership, mortgages, embargoes, urbanistic classification, whether the property is registered at allLand Registry (Colegio de Registradores)You may buy an unregistered or charged property, or one with no lawful construction entry
Licencia de primera ocupacionLawful completion of a new build, passing final inspectionTown hall (Ayuntamiento)The property may be an illegal build with no completion certificate
AFO certificationStatus as asimilado a fuera de ordenacionTown hall (Ayuntamiento)No documented tolerance regime; utilities may be cut; no registry access
Urbanistic classification checkLand class: urban, urbanisable, or non-urbanisableTown hall and CatastroExisting structures may exceed what the land classification permits
Community debt certificateOutstanding comunidad de propietarios fees owed by the sellerComunidad de PropietariosUnpaid fees transfer to the new owner under the Horizontal Property Act
Certificado de fin de obraConstruction completed per the approved projectTown hall (Ayuntamiento)The technical basis for the first-occupation licence is absent

The nota simple is the foundational search. The Colegio de Registradores describes it as a document showing the description of the property, the titular ownership, and any charges (mortgages, embargoes) that burden it. Crucially, it also shows whether the property is registered at all. An unregistered rural villa is a red flag that demands further investigation. The nota simple has informational value; a full certificacion registral is the only document that fehacientemente (reliably) proves registry content, but for standard transactions the nota simple is the working document.

The urbanistic classification check is the one most buyers never hear about. It confirms whether the land is classified as urban (fully serviced, buildable), urbanisable (designated for future development), or non-urbanisable (rural, protected, or agricultural). A villa on non-urbanisable land without an AFO certificate is the highest-risk scenario on the Costa del Sol. Your lawyer obtains this from the town hall’s urbanismo department, cross-referenced with Catastro data.

For a fuller view of where buyers commonly go wrong, see our guide on the common mistakes buying property in Spain, and for the total cost picture including the taxes and fees that fund these checks, our cost of buying property on the Costa del Sol guide.

Is the cedula de habitabilidad required in Andalusia?

No, and this is one of the most widespread misconceptions among foreign buyers and even some agents. The Junta de Andalucia suppressed the cedula de habitabilidad by Decreto 283/1987 of 25 November, which also eliminated the mandatory hygienic-conditions report that preceded municipal works licences. The decree’s rationale was to simplify administrative procedures and eliminate a duplicated control.

What replaced it functionally is the licencia de primera ocupacion for new builds. The Junta’s own compraventa guidance confirms that for new construction, the promoter must deliver the licencia de primera ocupacion to the buyer. For resales, some town halls issue a licencia de segunda ocupacion, but it is not a uniform statutory requirement across Andalusia in the way the cedula is in Catalonia or the Balearics.

If an agent tells you a cedula de habitabilidad is needed for your Andalusian purchase, that is a sign they are applying another region’s rules or outdated information. The relevant document is the first-occupation licence (for newer properties) or the AFO certificate (for older rural properties that were never licensed).

Can you mortgage an AFO or illegal-build property?

Spanish banks are conservative on construction legality. A mortgage requires a valuation (tasacion), and the valuer will not value a property that lacks lawful construction status. Without a valuation, there is no loan.

AFO properties occupy a grey zone. Because AFO allows registry inscription and basic utility connections, some lenders will consider them. However, the legal uncertainty is reflected in the valuation, which typically comes in below what a comparable legal build would fetch. Loan-to-value ratios are lower, interest rates may be higher, and some banks decline AFO outright. If you are financing, confirm your bank’s AFO policy before committing to the purchase, not after.

For an overview of non-resident borrowing parameters, see our guide on non-resident mortgages in Spain. For the off-plan safety framework that prevents illegal-build risk at the construction stage, our off-plan buying mechanics guide covers bank guarantees and stage payments.

What warranty rights protect buyers of new builds?

If you are buying a property less than ten years old, the Ley 38/1999 de Ordenacion de la Edificacion gives you statutory warranty rights against the developer and builder. The Junta de Andalucia’s compraventa guidance summarises the three periods:

  • 10 years for structural defects affecting foundations, load-bearing walls, beams, slabs, and other elements that compromise mechanical resistance and building stability.
  • 3 years for defects in construction elements or installations that cause a failure of habitability requirements.
  • 1 year for finishing and surface defects, for which the builder is directly responsible.

These rights apply only to lawful builds with a licencia de primera ocupacion. An illegal build, even if recent, does not benefit from this framework because the developer was never licensed. For newer properties, also see our snagging checklist for new builds to identify defects at handover before the one-year surface warranty expires.

How to protect yourself: a practical sequence

  1. Before viewing properties, instruct an independent Spanish lawyer (abogado). Do not rely on the selling agent’s in-house legal service.
  2. Before any deposit or arras contract, request a nota simple and an urbanistic classification check.
  3. If the property is on rural land or was built more than six years ago without a traceable licence, request an AFO status check from the town hall.
  4. If the property is under ten years old, verify the licencia de primera ocupacion and the developer’s bank guarantee (for off-plan purchases).
  5. If financing, confirm your bank’s policy on AFO or non-urbanisable-land properties before you commit.
  6. If any check fails or is inconclusive, walk away or negotiate a price that reflects the legal risk. A cheap illegal build is not a bargain if you cannot mortgage it, extend it, or sell it cleanly.

This guide is general information, not legal or tax advice. Rules change and individual circumstances differ. Verify current requirements with an independent lawyer (abogado) or tax advisor (gestor/asesor fiscal) before acting.

Frequently asked questions

Can I buy a property with AFO status?
Yes, but with significant caveats. AFO does not legalise the building; it only recognises that enforcement is no longer possible and allows access to basic services. You can register it in the Property Registry and connect utilities, but you cannot extend or renovate beyond essential maintenance. Mortgage options are limited and terms are typically worse than for a lawful build.
What is the difference between AFO and a licencia de primera ocupacion?
A licencia de primera ocupacion confirms a new build was completed lawfully, with all planning permissions in place and a final inspection passed. AFO applies to buildings constructed without a licence where the statutory enforcement period has expired. One is proof of compliance; the other is a tolerance regime for non-compliance.
Is a cedula de habitabilidad required in Andalusia?
No. The Junta de Andalucia suppressed the cedula de habitabilidad by Decreto 283/1987 of 25 November. The equivalent function is served by the licencia de primera ocupacion for new builds. Some town halls issue a licencia de segunda ocupacion for resales, but it is not uniformly required across the region.
How do I check if a Costa del Sol property is an illegal build?
Your lawyer should request a nota simple from the Land Registry, verify the urbanistic classification at the town hall, and confirm that a licencia de primera ocupacion or certificado de fin de obra exists for the construction. If the property sits on rural land, an AFO status check at the town hall is essential.
Can I get a mortgage on an illegal build in Spain?
Generally no. Spanish banks require a valuation, and valuers will not value a property without lawful construction status. AFO properties may be valued by some lenders, but at a discount reflecting the legal uncertainty, and mortgage terms are typically stricter than for a fully legal build.

Sources and data