Article 245 [source]

Spanish Criminal Code
English translation

1. Anyone who, through violence or intimidation, occupies real property or usurps a real property right belonging to another, shall be punished, in addition to the penalties incurred for the violence committed, with imprisonment for one to two years, the length of which shall be determined taking into account the benefit obtained and the damage caused.

2. Anyone who occupies, without due authorization, real property, a dwelling, or a building belonging to another that does not constitute a residence, or remains therein against the will of its owner, shall be punished with a fine of three to six months.