section_path: End of the global empire (1808–1899)
section_name: End of the global empire (1808–1899)
paragraph_text: End of the global empire (1808–1899)
  
  In 1808, Napoleon maneuvered to place the Spanish king under his control, effectively seizing power without facing resistance. This action sparked resistance from the Spanish people, leading to the Peninsular War. This conflict created a power vacuum lasting nearly a decade, followed by civil wars, transitions to a republic, and eventually the establishment of a liberal democracy. Spain lost all the colonial possessions in the first third of the century, except for Cuba, Puerto Rico and, isolated on the far side of the globe, the Philippines, Guam and nearby Pacific islands, as well as Spanish Sahara, parts of Morocco, and Spanish Guinea.
  
  The wars of independence in Spanish America were triggered by another failed British attempt to seize Spanish American territory, this time in the Río de la Plata estuary in 1806. The viceroy retreated hastily to the hills when defeated by a small British force. However, when the Criollos ' militias and colonial army decisively defeated the now reinforced British force in 1807, they promptly embarked on the path to securing their own independence, igniting independence movements across the continent. A long period of wars followed in the Americas, and the lack of Spanish troops in the colonies led to war between patriotic rebels and local Royalists. In South America this period of wars led to the independence of Argentina (1810), Gran Colombia (1810), Chile (1810), Paraguay (1811) and Uruguay (1815, but subsequently ruled by Brazil until 1828). José de San Martín campaigned for independence in Chile (1818) and in Peru (1821). Further north, Simón Bolívar led forces that won independence between 1811 and 1826 for the area that became Venezuela, Colombia, Ecuador, Peru and Bolivia (then Upper Peru). Panama declared independence in 1821 and merged with the Republic of Gran Colombia (from 1821 to 1903). Over the course of nine years, 20,000 Spanish soldiers were sent to reinforce the Spanish American Royalists in northern South America. However, disease and combat claimed the lives of 16,000–17,000 of these soldiers. Even within the Viceroyalty of Peru, the center of Spanish power in South America, the majority of the Royalist army consisted of Americans. After the Battle of Ayacucho, the captured Royalist army consisted of 1,512 Spanish Americans and only 751 Spaniards.
  
  Santo Domingo likewise declared independence in 1821 and began negotiating for inclusion in Bolivar's Republic of Gran Colombia, but was quickly occupied by the former French colony of Haiti, which ruled it until an 1844 revolution. After 17 years of independence, in 1861, Santo Domingo was again made a Spanish colony due to Haitian aggression, marking the only instance of a Spanish colonial possession returning to Spain after gaining independence. However Santo Domingo regained independence in 1865 through the Dominican Restoration War. Spanish losses against the Dominican rebels amounted to 10,888 soldiers killed or wounded in action, with the majority of the remaining approximately 30,000 troops succumbing to disease.
  
  Uprisings in Cuba and the Philippine Islands culminated with the Spanish–American War of 1898. On 1 May, the US Navy destroyed the Spanish Pacific fleet at the Battle of Manila Bay. In Cuba, the Battle of Las Guasimas, Battle of El Caney, and Battle of San Juan Hill were counted as American victories, although the Spanish Army inflicted higher casualties during these engagements. The U.S. Army failed to capture the heavily fortified city of Santiago on 1 July, but two days later an American fleet that included five battleships destroyed the Spanish Caribbean squadron at the Battle of Santiago de Cuba.
  
  Military defeat was followed by the U.S. occupation of Cuba and the cession of Puerto Rico, Guam, and the Philippines to the United States, receiving US$20 million in compensation for the Philippines. The following year, Spain then sold its remaining Pacific Ocean possessions to Germany in the German–Spanish Treaty, retaining only its African territories. On 2 June 1899, the second expeditionary battalion Cazadores of Philippines, the last Spanish garrison in the Philippines, which had been besieged in Baler, Aurora at war's end, was pulled out, effectively ending around 300 years of Spanish hegemony in the archipelago.