The office was first organized in 1812, during the War of Independence, under the name of Foreign Affairs Secretariat. It was abolished in 1814, after the Battle of Rancagua, when the Spanish government was re-established.