Spain has a strong tradition of squatting. Squatters are known as "okupas" and are particularly common in Barcelona. Squatters rights used to be strong, however, the 1990s saw the Spanish government clamp down on the practice.
During the 1980s thousands of illegal squatters were legalised. Some large, commune-like squats are still tolerated by the community. An example of a well-established and tolerated squat is Can Masdeu, a former leprosy asylum on the edge of Barcelona.
Article 245 of the Spanish Código Penal was enacted in 1996. It prohibits squatting and defines okupas as lawbreakers. After this legislation was passed, many squatters were evicted by police.
Despite the illegality of squatting in Spain, it can still be difficult for property owners to rid themselves of squatters. Police do not always act quickly and it is possible you may encounter legal problems if you try to remove them yourself.
According to a 2007 interview with a Spanish squatter published online at Cafe Babel, it is not uncommon for property owners to take matters into their own hands if the police eviction procedure is too slow. "Matones" are hired thugs which have been known to be used to threaten squatters.