How the Spanish Penal Code Treats Foreign Nationals
In this post, we analyze the key aspects that every foreign national should know about the Spanish Penal Code.
29/04/2025

📝- Index
The presence of foreign nationals in Spain poses legal challenges that the Penal Code addresses with an approach aimed at balancing respect for human rights with the need to maintain public order. What happens when a foreign national commits a crime on Spanish territory? Are they subject to the same punishment as a citizen? Can they be deported instead of serving a sentence? The Spanish legal system establishes a specific framework for the treatment of foreigners, both in its protective and punitive aspects. In this article, we explore how the Penal Code treats foreigners.
Deportation of Foreign Nationals in the Spanish Penal Code
Article 89 of the Penal Code regulates in detail the circumstances under which the deportation of foreign nationals convicted of crimes is applicable. This measure, although judicial in nature, is aimed at both public interest and respect for human rights. There are different circumstances for judicial deportation:
- Prison sentences of more than one year: Generally, the sentence is replaced by deportation. However, partial compliance of the sentence in Spain may be ordered before executing the deportation, especially if the foreign national reaches the third prison degree or conditional release.
- Sentences longer than five years: The judge may order that part of the sentence be served in Spanish territory. Afterward, the final deportation is carried out.
These provisions pursue two objectives: preventing recidivism and ensuring proportional punishment compliance.
Fundamental Rights of Foreign Nationals in Spain
Despite being subject to measures such as deportation, foreign nationals retain a series of rights protected by the Organic Law on the Rights and Freedoms of Foreign Nationals.
Essential recognized rights:
- Right to physical and moral integrity.
- Equality before the law with Spanish citizens.
- Access to effective judicial protection.
In special situations, such as those of trafficking victims or protected witnesses, the law provides additional guarantees, including options for regularizing their immigration status.
Cooperation with Justice as a Path to Protection
There are legal mechanisms that allow foreign nationals to obtain legal protection and even regularize their immigration status if they cooperate actively with justice. This cooperation can lead to benefits such as:
- Exemption from administrative sanctions.
- Special protection as a witness.
- Temporary suspension of deportation processes.
Preventive Measures: Key to Avoiding Legal Issues
To reduce the risk of facing sanctions or deportation, foreign nationals should consider key aspects of compliance:
- Updated documentation: Keeping residence and work permits in order is vital to avoid sanctions.
- Professional advice: When facing any legal notification or procedure, having a lawyer specialized in immigration is crucial.
- Knowledge of rights: Being informed prevents abuses and allows for better defense.
✅ Check out our immigration services and find out how we can help you protect your rights, regularize your situation, and avoid unnecessary legal sanctions.

Do you have any questions?
If you have any questions after reading "How the Spanish Penal Code Treats Foreign Nationals", we are here to help you.
Let's talk. We guide you clearly and step by step.