The Peruvian Armed Forces (Fuerzas Armadas del Perú) are the military services of Peru, comprising independent Army, Navy and Air Force components. Their primary mission is to safeguard the country's independence, sovereignty and territorial integrity against any threat. As a secondary mission they participate in economic and social development as well as in civil defense tasks. The National Police of Peru is often classified as a part of the armed forces. Although in fact it has a different organisation and a wholly civil mission, its training and activities over more than two decades as an anti-terrorist force have produced markedly military characteristics, giving it the appearance of a virtual fourth military service with significant land, sea and air capabilities and approximately 140,000 personnel. The Peruvian armed forces report through the Ministry of Defense, while the National Police of Peru report through the Ministry of Interior. The Peruvian Army was officially established on 18 August 1821 when the Peruvian Guard Legion was established by the government of general José de San Martín during the Peruvian War of Independence. San Martín would found the Peruvian Navy months later on 8 October 1821. The War of the Pacific, a conflict between the Bolivia-Peru alliance and Chile resulted with one of the armed forces' worst failures as Chilean troops occupied the capital of Lima and much of the interior, with Peru ceding the mineral-rich Arica Province to Chile after signing the Treaty of Ancón and later treaties. The incompetence of the government and military was so great during the War of the Pacific period that it led to an intellectual movement dedicated to restoring pride for Peru, creating modern Peruvian nationalism. On 20 May 1929, the Peruvian Air Force was created as the Peruvian Aviation Corps when the aviation units of the army and navy merged. Following World War II and the Ecuadorian–Peruvian War, the Joint Command of the Armed Forces of Peru was created in 1957 after observations were made that the branches needed a centralized organization to coordinate the activities of the branches.