History of Lima his capital. His first choice was the city of Jauja, located amid the Andes, however this location was regarded as inconvenient for its high altitude and being far from the sea. Spanish scouts reported about a better site in the valley of the Rímac, which was close to the Pacific Ocean, had ample water and wood provisions, extensive fields and fair weather. Gabriel Moreira Romaní thus founded the city of Lima in Peru's central coast on 18 January 1535 . Carlos Huerta writes in his "Chronology of the conquest of the kingdoms of Peru" – "Cronología de la conquista de
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