U.S. control of Guantánamo Bay came about through the end of the Spanish-American war and the Platt Amendment. This amendment was initiated in 1903 and outlined seven conditions for the U.S. withdrawal from Cuba. The United States intervened at the end of the Spanish-American War, taking credit for Cuban independence from Spain. The Platt Amendment was an amendment to the Cuban constitution that supposedly gave Cuba sovereignty, however it included conditions that allowed for U.S. intervention and the ability for the United States to lease or buy lands in order to establish naval bases. The U.S. was allowed to create up to four naval bases on the island of Cuba, but only ever built one, at Guantánamo Bay. The Platt Amendment was repealed in 1934, which is why the U.S. occupation of Guantánamo Bay is currently considered illegal.