Although diplomacy is a very old activity, and its use in Portugal goes back to the time of the Portucalense County, the first Secretariat of State dedicated to State affairs was created by King D. João IV after the Restoration (1640). Through a charter of November 29, 1643, three secretariats were created: the Secretariat of State, the Secretariat of Mercy and Expedient, and the Secretariat of Signature.
The Secretary of State was responsible for matters relating to negotiations (treaties, marriages and alliances), communication with foreign statesmen about peace and war, and the sending of diplomatic agents abroad.
Later, in the reign of D. João V, within the reorganization of the Public Administration, resulting from the experience of the first half of the 18th century, three Secretariats of State were created (July 28, 1736): the Kingdom’s Interior Affairs, Navy and Overseas Domains, and Foreign Affairs and War.
Foreign Affairs and War remained together in the same Secretariat until 1820 (except for an ephemeral separation, from January 6 to July 28, 1801). An ordinance of the Provisional Junta of the Government of September 27, 1820 determined that the two branches of the Public Administration were distinct and handed over to the management of different persons. This separation was confirmed definitively by Letter of Law on June 12, 1822 and also by a charter on September 30, 1828.
Throughout time, the Secretariat for Foreign Affairs was assigned, through the different diplomas that regulated its functioning, the competences that to this day belong to the Ministry of Foreign Affairs.