By 1830, all that remained of the Spanish territories in the West Indies were Puerto Rico and Cuba. Spain was confronted with rebellious colonies in the early 19th century and tried to pacify Cuba and Puerto Rico by giving them representation in the Spanish parliament in Madrid. This was reversed in 1837 and this, along with the 1865 emancipation of the slaves in the US, led to revolts in these two slave-owning colonies. Although a rebellion in Puerto Rico was suppressed, the Cuban wars took place from 1868–78. The US supported Cuba and in 1898, after the cessation of hostilities, Spain ceded Cuba to the US to oversee its independence. Although crops like nutmeg, cocoa and limes were important to the West Indian economies, sugar had been its mainstay. By 1910 the sugar market had begun to collapse in the Caribbean, with European beet-sugar acting as a cheaper alternative.