Final answer:
Cuba gained independence from Spain after the Spanish-American War, with the formal recognition coming in 1902, although it remained under the influence of the United States.
Step-by-step explanation:
As a result of the Spanish-American War, Cuba gained independence from Spain. After intense fighting and the defeat of the Spanish fleet by the U.S. Navy in 1898, the Spanish Crown agreed to Cuban independence while ceding Puerto Rico, Guam, and the Philippines to the United States. While Cuba officially became independent in 1902, it remained under significant U.S. influence, as reflected in the imposition of the Platt Amendment into the Cuban constitution, allowing U.S. intervention in Cuban affairs.
As per the terms of the treaty, Spain ceded control of several of its colonies, including Cuba, Puerto Rico, Guam, and the Philippines, to the United States. While the Philippines came under American control, Cuba gained independence, marking the end of Spanish colonial rule in the Caribbean nation.