Article 314 [source]

Spanish Criminal Code
English translation

Those who commit serious discrimination in public or private employment against any person on account of their ideology, religion or beliefs, family situation, ethnicity, race or nationality, national origin, sex, age, sexual orientation or gender identity, gender-based reasons, aporophobia or social exclusion, illness or disability, holding legal or union representation of workers, kinship with other workers of the company or use of any of the official languages within the Spanish State, and fail to restore equality before the law after a request or administrative sanction, repairing the resulting economic damages, will be punished with a prison sentence of six months to two years or a fine of twelve to twenty-four months.