The age of consent in Spain is 13, as specified by the Spanish Penal Code, Article 181(2). However, if deceit is used in gaining the consent of a minor under 16 years an individual can be charged under Article 183(1) upon parental complaint.
"181(1) El que, interviniendo engaño, cometiere abuso sexual con persona mayor de trece años y menor de dieciséis, será castigado con la pena de prisión de uno a dos años, o multa de doce a veinticuatro meses.
(Approximate translation: An individual who, by use of deceit, commits sexual abuse with a person over thirteen years and under sixteen years, will be punished with imprisonment for one or two years, or a fine equivalent to twelve to twenty-four months...)
(2) A los efectos del apartado anterior, se consideran abusos sexuales no consentidos los que se ejecuten sobre menores de trece años, sobre personas que se hallen privadas de sentido o de cuyo trastorno mental se abusare."
(Approximate translation: To the effects of the previous section, it is considered unconsenting sexual abuse if sexual acts are committed against persons under thirteen years, unconscious persons or persons whose mental illness is taken advantage of....)"
History
Homosexual acts had been legal in Spain from 1822 to 1933, (with the exception of the offence of “habitual homosexual acts" in the years 1928-32) and even not specifically mentioned there, some homosexuals were arrested under the "Ley de Vagos y Maleantes" (Law against the Lazy and common deliquents) during the 2nd Spanish republic. Homosexual acts were illegal during Francisco Franco's regime, which created a specific law against them (Ley de Peligrosidad Social). A new Criminal Code was introduced in 1995 which specified an age of consent of 12 under Article 181f for all sexual acts; and this was raised to 13 in 1999.