Article 241 [source]

Spanish Criminal Code
English translation

1. Theft committed in an inhabited dwelling, building, or premises open to the public, or in any of its outbuildings, shall be punished with a prison sentence of two to five years. If the acts are committed in an establishment open to the public, or in any of its outbuildings, outside of opening hours, a prison sentence of one to five years shall be imposed.

2. An inhabited dwelling is considered to be any dwelling that constitutes the residence of one or more persons, even if they are temporarily absent from it when the theft takes place.

3. Outbuildings of an inhabited dwelling or building or premises open to the public include its courtyards, garages, and other enclosed areas or spaces adjacent to and connected to the building, with which they form a single physical unit.

4. A prison sentence of two to six years will be imposed when the facts referred to in the previous sections are of special gravity, taking into account the way in which the crime is committed or the damage caused and, in any case, when any of the circumstances expressed in article 235 occur.