Although modernization and reform have set the stage for the wars for independence, it is the Napoleonic Wars—especially Napoleon's invasion of Spain when he sparked rebellion by removing King Fernando VII from power in 1808—that trigger Spanish America's wars for independence.