Batista had been elected as the president of Cuban people but later he declared himself Dictator. Many people in Cuba were unhappy with his rule because of unemployment, poverty, and poor education, etc.
In 1959, Castro overthrew the Batista government seized all political power and declared himself Dictator of Cuba.
The United States planned to support Castro to overthrow the Batista government and Castro was supported by the United States because he insured to make Cuba a democratic country.
The United States even sent him types of equipment to support defeat, Batista.