Article 171 [source]

Spanish Criminal Code
English translation

1. Threats of harm that do not constitute a crime shall be punished with imprisonment for three months to one year or a fine of six to 24 months, depending on the seriousness and circumstances of the act, when the threat is conditional and the condition does not consist of a required action. If the perpetrator achieves their purpose, the penalty shall be increased by half.

2. If someone demands a sum of money or reward from another under the threat of revealing or disseminating facts concerning their private life or family relationships that are not publicly known and that could affect their reputation, credit, or interests, they shall be punished with imprisonment for two to four years if they obtain all or part of what is demanded, and with imprisonment for four months to two years if they do not.

3. If the act described in the preceding paragraph consists of a threat to reveal or report the commission of a crime, the public prosecutor may, in order to facilitate the punishment of the threat, refrain from prosecuting the crime whose disclosure was threatened, unless it is punishable by imprisonment for more than two years. In the latter case, the judge or court may reduce the sentence by one or two degrees.

4. Anyone who makes a minor threat against their current or former spouse, or a woman with whom they have or have had a similar relationship of affection, even without cohabitation, shall be punished with imprisonment for six months to one year or community service for thirty-one to eighty days and, in all cases, deprivation of the right to possess and carry firearms for one year and one day to three years, as well as, when the Judge or Court deems it appropriate in the best interests of the minor or person with a disability in need of special protection, special disqualification from exercising parental authority, guardianship, curatorship, custody, or foster care for up to five years.

The same penalty shall be imposed on anyone who makes a minor threat against a particularly vulnerable person living with the perpetrator.

5. Anyone who in a minor way threatens with weapons or other dangerous instruments any of the persons referred to in article 173.2, except those contemplated in the previous section of this article, shall be punished with a prison sentence of three months to one year or community service of thirty-one to eighty days and, in any case, deprivation of the right to possess and carry weapons for one to three years, as well as, when the Judge or Court considers it appropriate to the interest of the minor or person with a disability in need of special protection, special disqualification for the exercise of parental authority, guardianship, curatorship, custody or foster care for a period of six months to three years.

The penalties provided for in paragraphs 4 and 5 shall be increased by half when the offense is committed in the presence of minors, or takes place in the shared residence or the victim's residence, or is committed in violation of a penalty stipulated in Article 48 of this Code or a precautionary or security measure of the same nature.

6. Notwithstanding the provisions of paragraphs 4 and 5, the Judge or Court, stating the reasons for doing so in the judgment, may, taking into account the personal circumstances of the perpetrator and those present at the time of the offense, impose a lesser penalty.

7. Outside of the cases mentioned above, anyone who makes a minor threat against another person shall be punished with a fine of one to three months. This offense shall only be prosecuted upon complaint by the aggrieved party or their legal representative. When the offended party is one of the persons referred to in section 2 of article 173, the penalty shall be permanent location for five to thirty days, always in a different and distant address from that of the victim, or community service for five to thirty days, or a fine of one to four months, the latter only in the cases in which the circumstances expressed in section 2 of article 84 occur. In these cases the complaint referred to in the previous paragraph will not be required.