
They acted to some extent like the Fehmic courts of Germany. The hermandades were occasionally co-opted for dynastic purposes. With the countryside virtually everywhere effectively in the hands of nobles, throughout the High Middle Ages such brotherhoods were frequently formed by leagues of towns to protect the roads connecting them. The first recorded case of the formation of an hermandad occurred when the towns and the peasantry of the north united to police the pilgrim road to Santiago de Compostela in Galicia, and protect the pilgrims, a major source of regional income, against robber knights. These organizations were individually temporary but became a long-standing fixture of Spain. The medieval kings of León, Castile, and Aragón were often unable to maintain public peace, protective municipal leagues began to emerge in the twelfth century against bandits and other rural criminals, as well as against the lawless nobility or mobilized to support a claimant to the crown. Operational policy and major interventions are nationally coordinated under the direction of the Ministry of the Interior. Locally, all enforcement agencies work together closely, and in serious matters, usually under the guidance of an examining magistrate. Despite their civilian status, the officers are trained by both the National Police and the Navy Marines. The Customs Surveillance Service is responsible for the investigation and prosecution of cases involving contraband, illegal drugs, financial evasion and violations, money laundering, surveillance for financial police purposes, and the provision of judicial police services.

Answers to the local governments (81,000). The Policía Local or Policía Municipal (known as Urban Guard in the city of Barcelona) operate in most cities and important towns, concentrating on preventing crime, settling minor incidents, traffic control, and, crucially, intelligence gathering.In some Autonomous Communities, autonomous police forces have taken over many of the CNP duties. The Policía Nacional or Cuerpo Nacional de Policía (the National Police Corps, or CNP) has a civilian status and deals with criminal offences and public order in big towns and cities (65,000).Answers to both the Ministry of Interior and the Ministry of Defence. They operate from garrison posts that are called Casas cuartel ("home-garrisons") which are both minor residential garrisons and fully equipped Police stations. It patrols the entire national territory (including highways and ports), except for those areas that belong to the National Police, enforces customs duties and investigates crimes therein (78,000). It is the most powerful police force in Spain.

The Guardia Civil (Civil Guard) is the national gendarmerie force and therefore has a military status.Law enforcement in Spain is carried out by numerous organizations, not all of which operate in the same areas.
