The Ministry of Foreign Affairs, European Union and Cooperation (MAEUEC) is a department of the Government of Spain responsible for the country's foreign policy and relations, paying special attention to the ones in relation to the European Union and Ibero-America, as well as managing Spain's international cooperation for development policy. In these sense, it is responsible for promoting international economic, cultural and scientific relationships, taking part in the proposal and enforcement of the migration policy, promoting cross-border and interterritorial cooperation, protecting Spaniards abroad and preparing and negotiating the international treaties which Spain is part of.

The Foreign Ministry is the nationwide department that oversees the Foreign Action of the rest of government departments, the Spanish regions and other administrations, as well as overseeing the Foreign Action of the constitutional bodies. In this sense, from the Ministry depends the Spanish Foreign Service, the set of individuals, bodies and institutions with competence in foreign matters. , the ministry maintains 218 diplomatic posts around the world, including 116 embassies and 91 consulates. This number does not includes the 73 cooperation units of the AECID (cooperation offices and cultural and training centers) and the 103 Instituto Cervantes centers around the world.

Established in 1714 with the creation of the first five specialized government departments —State, Justice and Ecclesiastical Affairs, War, Navy and the Indies, and Finance—, it is headed by the Foreign Minister, who is appointed by the Monarch on the advice of the Prime Minister. The minister of foreign affairs is one of the most important offices of the Council of Ministers, ranking only behind the royal family, the prime minister, and deputy prime ministers, if any, in protocol. The current foreign minister is José Manuel Albares, former ambassador to France, who was appointed on 12 July 2021.

History

Early period Diplomacy was born with the first Nation-States, being Spain one of the oldest Nation-States that continues to exist today. The first diplomatic relations of Spain as a unified entity began to be carried out with the Catholic Monarchs, who established permanent embassies to the Holy See, Venice, London, Holy Roman Empire or Paris, among others—, many of which are still in operational.

This meant that, by 1500, the Spanish Monarchy had a permanent foreign service distributed across the major European powers —the largest of its time— which would be strengthened during the reigns of Charles I and Philip II due to the need to protect the interests of the Empire. The creation of the Council of State will centralize diplomatic information through it, gaining prestige and giving rise to the figure of the Secretary of the Council of State or Secretary of State, a dignity that will later pass to the ministers during the time of the first Bourbons. In 1625, the position of conductor, later known as introductor de embajadores (introducer of ambassadors) was created.

The Peace of Westphalia of 1648, in addition to ending the Thirty Years' War and the Eighty Years' War, was the first modern diplomatic congress. This event is considered the birth of international relations as we know them today, establishing a new order in Europe based on the concept of national sovereignty. Ambassadors already existed and gradually strengthened their functions, becoming essential elements of foreign policy, a foreign policy closely controlled by the Crown.

During the reign of Philip V, in 1705, the Secretariat of the Universal Bureau was divided, giving rise to a Secretariat for matters of War and Finance and another "for everything else". This last Secretariat is considered by some authors as the beginning of what we know today as the Ministry of Foreign Affairs, although the most widespread position is that its creation dates back to 30 November 1714, when the government was structured into four secretariats of state and a Veeduría General for the Royal Treasury.

These were the five original government departments:

The First Secretariat of State, which handled matters "of State, including negotiations and correspondence with other Sovereigns, and with their Ministers and those of foreign countries, which must be conducted and dealt with by a single party". The Secretariat of State for "everything pertaining to the [Catholic] Church and Justice, and the jurisdiction of the Councils and Courts". The Secretariat of State for "war affairs". The Secretariat of State for "matters of the Indies and those pertaining to the Navy". The Veeduría General. Treasury affairs were entrusted to Jean Orry. Although the Veeduría was not described as a secretariat of state, it was de facto one, since, as the Royal Decree states, he participated in, advised, and reported to the Cabinet Council (a kind of council of ministers where the Secretaries of State met).

Following the creation of the Secretariat of State, which was entrusted to The Marquess of Grimaldo, former secretary of state for war and treasury, it assumed much of the powers that the Council of State had over foreign policy, leaving this Council as an advisory and debate body, since the powers over appointments and economic management of diplomacy as well as correspondence between chancelleries were assigned to the secretary of state. However, this Secretariat was not only responsible for foreign relations, but also assumed a large part of domestic policy; it governed the royal sites, supervised the postal service and it had a relevant role in the creation of Royal Academies and in the process of granting new aristocratic honours, and it assisted the monarch in issuing decrees and in the relations between the Crown and other institutions, making it the center of the government and, in practice, its officeholder was a prime minister, reason why he was known as "First Secretary of State". An example of this was that the new ministers of the royal cabinet were sworn in before this "prime minister". Despite the power and the similarities to this modern figure, the secretary of state was not a prime minister and, on many occasions, he was overshadowed and subordinated to the king's favourite, as happened with Giulio Alberoni (1715–1719), The Baron Ripperda (1725–1726) or The Prince of the Peace in the reign of Charles IV.

In later years, this body evolved similarly, as its new leaders, especially the Count of Floridablanca and The Prince of the Peace, continued the trend of monopolizing much of the political power, overshadowing their peers. Thus, their powers increased over the economic and governmental management of the Royal Sites, the management of a large part of the responsibilities of the Secretariat of the Indies, the General Superintendency of Granaries, local roads, the General Agency of Prayers to Rome, the Madrid police, charities, orphanages, printing, the press, schools, the orders of Charles III and Maria Luisa, the national archives, health, and industry, among many others.

All of the above must be understood without taking into account those matters in which the Secretary of State participated directly as a favorite of the king, without having the authority to do so, especially following the constitution of the Supreme Board of State in 1787, which, acting similarly to a Council of Ministers, assumed the weight of political decisions. With the fall of The Count of Floridablanca in 1792 and the coming to power of The Count of Aranda, he influenced King Charles IV to suppress this board and return to the previous system with the Council of State as the central organ of administration, although this did not reduce the dependence of the Secretariats of State from the First Secretariat of State.

Nineteenth century In 1812, the Cortes of Cádiz approved the first Spanish constitution, which included up to seven Secretariats of State, the first of which was the First Secretariat of State. One of the new departments was the Secretariat of the Government of the Kingdom, which assumed vast responsibilities regarding the domestic government.

After the Napoleonic Wars, the international relations changed and do so the foreign relations of Spain. In 1833, the Secretariat was renamed as Ministry of State, with Francisco Cea Bermúdez as minister. With this change, Spain was brought into line with its European peers and, with the approval of the Royal Statute of 1834, the Minister of State ceased to act as a prime minister when the figure of the President of the Council of Ministers was constitutionally conceived, although in the following years it was common for the holder of the presidency to also assume the portfolio of State.

On 16 June 1834, the Undersecretariat of the Ministry was created and the heads of the departments were authorized by The Queen Regent to organize its own ministerial offices. The following year, The Count of Toreno, prime minister and minister of state, reorganized his department with two sections: two for politics (responsible for diplomatic and political correspondence with embassies and other foreign representations and that of diplomatic agents and consuls of the Crown abroad), one for Trade and Consulates (responsible for the diplomatic and political correspondence of the Crown's diplomatic agents and consuls abroad on matters of science, arts, industry, commerce, and navigation; commercial treaties, and claims and notes relating to commercial matters. He was also, apparently temporarily, assigned responsibility for any political negotiations that might be initiated with the new states of South America) and another for Accounting and Internal Affairs (responsible for economic and budget affairs; human and material resources; matters relating to the royal family, grandees and nobility; advisory councils; introducer of ambassadors, crosses and honours; police, passports, licences and legalisations; and ultimately, all those matters that do not fit into the other sections).

From 1854 to 1858, the State Department managed the overseas affairs. During the First Republic, some elements related to the monarchy were eliminated, such as the position of introducer of ambassadors, defined then as a "useless wheel" of the administration, "pure apparatus and of no use", and the main orders of the State: Charles III, Isabella the Catholic and Noble Ladies of Queen Maria Luisa.

Once the Monarchy was reestablished with Alfonso XII as king, the measures approved during the young republic were reversed and the department began to be organized through an Undersecretariat and the sections (also called directorates) of Political Affairs, Administration and Accounting, and Trade and Consulates, as well as smaller departments of Archives and Library and the Secretariat of Language Interpretation.

The second term of The Marquess of Vega de Armijo as minister of state was a revolution. In September 1888, the Marquess reorganized the Ministry, increasing it from four to eleven sections, namely: Chancellery; Orders; European Policy; American Policy; Asian, African, and Oceanic Policy; Court Affairs; Commerce; Consulates; Accounting; Pious Works; and Archives, Library, and Language Interpretation.