In the early 19th century the Spanish colonies, in what is known as the Latin American wars of independence, began to revolt against Spanish rule. Antonio Valero de Bernabé was a Puerto Rican military leader known in Latin America as the "Liberator from Puerto Rico". Valero was a recent graduate of the Spanish Military Academy when Napoleon Bonaparte convinced King Charles IV of Spain to permit him to pass through Spanish soil with the sole purpose of attacking Portugal. When Napoleon refused to leave, the Spanish government declared war. Valero joined the Spanish Army and helped defeat Napoleon's army at the Siege of Saragossa. Valero became a hero; he was promoted to the rank of colonel and was awarded many decorations.