Lima conquistador Francisco Pizarro on January 18, 1535, as "Ciudad de los Reyes". It became the capital and most important city in the Spanish Viceroyalty of Peru. Following the Peruvian War of Independence, it became the capital of the Republic of Peru. Around one-third of the national population lives in the metropolitan area. Lima is home to one of the oldest institutions of higher learning in the New World. The National University of San Marcos, founded on May 12, 1551, during the Spanish colonial regime, is the oldest continuously functioning university in the Americas. In October 2013, Lima was chosen to
Lima under General José de San Martín landed south of Lima in 1820 but did not attack the city. Faced with a naval blockade and the action of guerrillas on land, Viceroy José de la Serna e Hinojosa evacuated its capital in July 1821 to save the Royalist army. Fearing a popular uprising and lacking any means to impose order, the city council invited San Martín to enter Lima and signed a Declaration of Independence at his request. However, the war was not over; in the next two years the city changed hands several times. After independence, Lima became the capital