His military experience on the peninsula, where he fought the French during the War of Independence, legitimized him to lead the rebels against the last bastion of Spain in South America, the Viceroyalty of Peru. The wars of independence in America were waged by the descendants of Spaniards, the Cre