The Prosecution Ministry (Spanish: Ministerio Fiscal) is a constitutional body (Part VI § 124) integrated into the Judiciary of Spain, but with full autonomy. It is entrusted with defending the rule of law, the rights of the citizens, and public interest, as well as watching over the independence of the courts of justice.

The requirements to enter into a career of prosecution are a public exam that can only be taken by those with a law degree who meet the required capacity requirements (EOMF § 42). The exam for admission to the judicial and prosecution careers are connected, so that anyone who passes the tests must proceed to the entry position of their chosen career. Those who choose prosecution must complete a training course at the Center for Legal Studies, after which they become a prosecutor by swearing the corresponding oath and taking possession of their jurisdiction (EOMF § 45).

Functions
To accomplish their mission as stated by the Constitution, the Prosecution Ministry Organic Regulation (EOMF) established the following as functions:

 Ensure that the jurisdictional function is exercised effectively in accordance with the laws and in the terms indicated therein, exercising, where appropriate, the appeals and relevant actions.
 Exercise all legal functions in defense of the independence of judges and courts.
 Ensure respect for constitutional institutions, fundamental rights, and public freedoms through as many actions necessary.
 Exercise criminal and civil actions arising from crimes and faults or oppose those exercised by others, when appropriate.
 Intervene in the criminal process, urging the judicial authority to adopt the appropriate precautionary measures and the practice of diligence aimed at clarifying the facts or directly instructing the procedure within the scope of the provisions of the Organic Law regulating the Criminal Responsibility of the Minors, being able to order the judicial police those diligences that it considers opportune.
 Take part, in defense of legality and public or social interest, in the processes related to civil status and in the others established by law.
 Intervene in civil proceedings that the law determines when the social interest is compromised or when they may affect minor, incapable or defenseless persons as long as the ordinary mechanisms of representation are provided.
 Maintain the integrity of the jurisdiction and competence of judges and courts, promoting conflicts of jurisdiction and, where appropriate, competition issues that arise, and intervene in those promoted by others.
 Ensure compliance with judicial decisions that affect the public and social interest.
 Ensure the procedural protection of victims and the protection of witnesses and experts, promoting the mechanisms provided for them to receive effective assistance and assistance.
 Intervene in the judicial proceedings of amparo as well as in the unconstitutionality issues in the cases and manner provided for in the Organic Law of the Constitutional Court.
 File appeals for constitutional protection, as well as intervene in the processes known to the Constitutional Court in defense of legality, in the manner established by law.
 Exercise in matters of criminal responsibility of minors the functions entrusted to it by specific legislation and direct their actions to the satisfaction of the best interests of the minor.
 Intervene in cases in the manner provided in the laws before the Court of Auditors, and defend the legality in the contentious-administrative and labor processes that foresee their intervention.
 Promote or provide international judicial assistance provided for in international laws, treaties and agreements.
 Exercise the other functions that the state legal system attributes to it.

Organization chart
The Public Prosecution Ministry is composed of numerous bodies, most of them in every judicial body but also in other special jurisdictions and matters (EOMF § 12).

 The Office of the Attorney General
 The Prosecution Council: A body composed of the highest prosecutors entrusted with the advisement of the Attorney General; to establish the organization of the Prosecution Ministry; to resolve disciplinary files and incompatibility matters and to resolve appeals against certain prosecutors' decisions, among others (EOMF § 14).
 The Board of Chamber Prosecutors: the Board assists the Attorney General of the State in doctrinal and technical matters, to form the unitary criteria of interpretation and legal action, the resolution of consultations, preparation of reports and circulars, preparation of projects and reports that must be elevated to the Government and any others, of an analogous nature, that the Attorney General deems appropriate to submit to its knowledge and study (EOMF § 15).
 The Board of High Prosecutors of the Autonomous Communities: Its function is to ensure the unity and coordination of the performance and functioning of the Prosecutor's Offices throughout the country, without prejudice to the powers attributed to the Prosecution Council (EOMF § 16).
 The Prosecution Office of the Supreme Court: It is headed by the Attorney General and it's also composed by the Lieutenant Attorney, the position that historically assumed the competences that today has the Attorney General. The Lieutenant Attorney acts as a second-in-command prosecutor replacing the Attorney General when this can't exercise its powers and directs the Supreme Court Prosecutor's Office by delegation of the Attorney General (EOMF § 17).
 The Prosecution Office before the Constitutional Court
 The Prosecution Office of the National Court
 The Special Prosecution Offices: There are two Special Prosecution Offices—the Anti-drug Prosecution Office and the Prosecution Office against Corruption and Organized Crime. They are characterized by having its own police units (provided by the State Police law enforcements) (EOMF § 19).
 The Prosecution Office of the Court of Auditors
 The Military Prosecution Office
 The Prosecutor's Offices of the Autonomous Communities
 The Provincial Prosecutors
 The Area Prosecutor's Offices

Principles
Article 124 of the Constitution which regulates the Prosecution Ministry, in its second paragraph establish the main four principles that should govern the action of the Public Prosecution:

Principle of unity of operation
This principle declares that the prosecution is unique to the entire country, emphasized by the Organic Regulation of the Prosecution Ministry making it clear that Ministerio Fiscal can only be used by this body (EOMF § 2). The attorney general holds the superior office of the Public Prosecution and represents it throughout Spain, corresponding to this position the issuance of convenient orders and instructions and the direction and inspection of the Prosecution Ministry. The attorney general is empowered to delegate functions in other Prosecutors related to the subject matter of its competence, though the delegation may be revoked at any time and is automatically extinguished with the dismissal of the attorney general (EOMF § 22).

To preserve the principle of unity in the performance of the Public Prosecution Office, the periodic celebration of all its components has been established by law. The agreements reached resemble a report, but if the chief prosecutor disagrees, their stance takes priority. Within the Prosecution Ministry, the action criterion is imposed by the higher bodies to the lower ones. (EOMF § 24).

Principle of hierarchical subordination
The hierarchical dependence on the organization of the Prosecution Ministry is considered to be a distinguishing factor from other bodies, such as jurisdictional ones, since the latter must be prevented from all kinds of internal influence. Therefore, judges, courts, their governing bodies, or the General Council of the Judiciary are not empowered to issue instructions, whether general or specific, addressed to their inferiors, on the application or interpretation of the legal system they make (LOPJ § 12). Contravening this provision is subject to severe disciplinary action (LOPJ § 417).

Principle of the rule of law
By the principle of the rule of law, also called principle of legality, the public prosecutor acts according to the Constitution, laws, and other regulations to rule, inform, and exercise actions for or opposing those improperly acted to the extent and how the laws establish it (EOMF § 6).

Principle of impartiality
Due to the principle of impartiality, the public prosecutor acts with full objectivity and independence in defense of the interests entrusted to it (EOMF § 7).

In no legal provision of the Spanish legal system is the recusal of the representative of the Public Prosecution for the mere fact that this is a procedural part, but contrary to this, the Organic Act of the Judiciary establish that any official that is part of the process and has any conflict of interest must self-abstain to be a part of the process. This clause is interpreted to extend to the prosecutors (LOPJ § 219). If the prosecutor does not comply with this clause, the process can escalate to their superior, who can order them to recuse themselves from the process (EOMF § 28).

History
In 1835, under the regency of Queen María Cristina, the Provisional Regulation for the Administration of Justice was approved, which did not specifically mention the Prosecution Ministry, but established a state-level prosecution organization topped by the Attorney of the Supreme Court.

The Prosecution Ministry was officially mentioned in the Organic Act of the Judiciary of 1870:

In 1886, the Prosecution Ministry lost rights over the defence of the interests of the Public Treasury in favour of the Solicitor General's Office.

Under Francoism, the Ministry lost many of its rights, and was used to execute orders and act as a channel of communication between the executive and judicial powers.

When Spain transitioned to democracy and the Constitution of 1978 was approved, the Ministry recovered its rights and was granted new ones, defending not only the interest of the State but also the citizens', their rights, and freedoms, as well as watch over the independence of justice. The Constitution integrated it into the Judiciary while giving it full autonomy without being under the authority of the General Council of the Judiciary. It stopped being a communication channel between the executive and judicial powers.

References
The information in this article has three main sources:
 The Constitution.
 The Organic Regulation of the Prosecution Ministry (EOMF).
 The Organic Act of the Judiciary (LOPJ)

Prosecution
Judiciary of Spain
Law enforcement in Spain
Legal organisations based in Spain