Ramón Castilla y Marquesado (Spanish pronunciation: [raˈmoŋ kasˈtiʝa] ; 31 August 1797 – 30 May 1867) was a Peruvian caudillo who served as President of Peru three times as well as the Interim President of Peru (Revolution Self-proclaimed President) in 1863. His earliest prominent appearance in Peruvian history began with his participation in a commanding role of the army of the Libertadores that helped Peru become an independent nation. Later, he led the country when the economy boomed due to the exploitation of guano deposits. Castilla's governments are remembered for having abolished slavery and modernized the state.
He began his military career in the royalist army, participating in the Battle of Chacabuco. Taken prisoner after the battle, he was taken to Buenos Aires where he obtained permission to leave the country and returned to Peru. Reinstated in the Royal Army of Peru, he joined the independence cause in early 1822. He organized and served in the cavalry of the Peruvian Legion distinguishing himself at the Battle of Ayacucho. He continued his military and political career, holding high public offices such as sub-prefect of his native Tarapacá and prefect of Puno during the administrations of Agustín Gamarra and Luis José de Orbegoso.