Article 401 [source]

Spanish Criminal Code
English translation

Anyone who usurps the civil status of another will be punished with a prison sentence of six months to three years.