The Spanish American wars of independence (Spanish: Guerras de independencia hispanoamericanas) took place across the Spanish Empire during the early 19th century. The struggles in both hemispheres began shortly after the outbreak of the Peninsular War, forming part of the broader context of the Napoleonic Wars. The conflict unfolded between the royalists, those who favoured a unitary monarchy, and the patriots, those who promoted either autonomous constitutional monarchies or republics, separated from Spain and from each other. These struggles ultimately led to the independence and secession of continental Spanish America from metropolitan rule, which, beyond this conflict, resulted in a process of Balkanization in Hispanic America. If defined strictly in terms of military campaigns, the time period in question ranged from the Battle of Chacaltaya (1809) in present-day Bolivia, to the Battle of Tampico (1829) in Mexico.
These conflicts were fought both as irregular warfare and conventional warfare. Some historians claim that the wars began as localized civil wars, that later spread and expanded as secessionist wars to promote general independence from Spanish rule. This independence led to the development of new national boundaries based on the colonial provinces, which would form the future independent countries that constituted contemporary Hispanic America during the early 19th century. Cuba and Puerto Rico remained under Spanish rule until the 1898 Spanish–American War.