The Cuban revolts against Spanish rule took place in the late 19th century and early 20th century in the form of the Ten Years' War, which led to the Spanish American War. The revolts began because the people of Cuba were unhappy with Spanish rule and wanted to create their own government.
Cuba had always been one of Spain's colonies, but the Cubans felt that Spain's inability to give them any self-governing power was unacceptable. This led to the formation of the Cuban Nationalists and the beginning of the Ten Years' War in 1868. Though it was ultimately unsuccessful, it did last 10 years and it fed the dissatisfaction with Spain of the Cuban people. In 1898, 20 years after the end of the Ten Years' War, the Cuban Nationalists attacked Spanish rule once again in the form of the Spanish-American War.
The Spanish-American War quickly pulled in the United States. The U.S. public wanted the government to help the Cubans win the war after they saw the images, which were distributed by newspaper outlets, of the violent methods the Spanish had used to control the Cubans. This led to Spain declaring war against the U.S. In the end, Cuba and the U.S. government would walk away victorious. Spain gave its colonies of Puerto Rico and Guam to the U.S. while finally giving Cuba its independence.