The origins of this body dated from the 18th century, when a Superintendent of Police was created to oversees the public order in the Kingdom. However, the truly precursor was the Directorate-General for Security and Public Order, which existed between march and October 1858. After this, the competences were directly assumed by the Ministry of the Interior but in 1912 was created the Directorate-General for Security that was in active service until 1986, when the current Secretariat of State for Security was born. The Directorate-General for Security was the main body responsible for the repression after the civil war and with the need of renovate the police and improve the image of the police corps, all the security departments were renamed and reorganizated.
Structure
From the Secretary of State for Security depends:
Director-General of the Police.
: It's the official which leads the civil department responsible for the direction and supervision of the National Police Corps actions, maintain international relationships with other police departments within the scope of its competences, issue of passports, IDs, immigration documents, private security licenses and other documents of its competence and provides the police with all the necessary materials
: It's the official which leads the civil department responsible for the direction and supervision of the Civil Guard actions in coordination with the Ministry of Defence, establish the territorial organization of the Civil Guard, supervise the Civil Guard's competences over weapons and explosives, provide the police with all the necessary materials and to establish a fluent coordination between the Directorate-General and the Secretary of State for Migrations in the competences of the Civil Guard over foreigners.
Secretary-General for Penitentiary Institutions.
: It's an official in charge of the department responsible for the organization and administration of prisons as well as de designment of programs to reinsert the prisoners into society, deals with the complaints and requests over prisons and over the prisons officials and is also in charge of maintain prisons in good condition and with maximum hygiene.
Director-General for International Relations and Immigration.
: The Director-General for International Relations and Immigration tops the Directorate-General for International Relations and Immigration which is responsible for the coordination of the international relations of the Ministry, the supervision of the police forces in embassies and other diplomatic missions abroad in coordination with the different directorates general of the polcie forces, the participation in the negotiations of international agreements over security and the supervision and improvement proposal over the migration issue.
Deputy Director-General for Planning and Management of Infrastructures and Means for Security.
: It's responsible for planning the investments in security infraestructures, for proposing and overseen the works in the scope of security, manage and execute the programs of its competence coming from European founds, manage the Ministry's goods and carry out all the competences that the Secretary of State delegates on it.
: It's responsible for planning the investments in information and communications systems, standardize and homogenize these systems, the proposal of acquisition of new systems and modernition of the existed, manage and execute the programs of its competence coming from European founds, coordinate and develop data bases, communication systems and information systems, coordinate the investments in security R&D and the direction of the Security Technological Center.