I listened a podcast episode by Wall Street Wolverine where real estate investor Pau Antó explains how he deals with squatters also know as "okupas" in Spain. Many people consider owning property very risky in Spain because the local law protects the habitants of the residence. I wrote for example blog post about it called "how to live for free in Spain". Still Antó has invested in real estate properties which were occupied by squatters. He classified squatters in three categories: squatters who see occupying a residence as a right, squatters who do business by occupying residences and squatters who do it because they don't have any other way to find a roof on top of their head.
Antó explained how you have to negotiate with the squatters before you invest in the property. Often you need to pay the squatters some thousands of euros to make a deal with them. You have to be able to trust their word, because legal contracts don't weigh much in their case. In Barcelona there is a valued neighborhood with good location called Grácia, where some buildings have been occupied for years and would interest investors. Still reaching a deal with squatters has been impossible and the buildings remain occupied. For example buildings where there are living squatters from different ethnic groups makes negotiating complicated. For the landlards Antó adivces to always have an insurance in case the tenant doesn't pay the rent.