Fidel Alejandro Castro Ruz was born on 13 August 1926 (some sources state 1927) on his family's sugar plantation near Biran. His father had come to Cuba from Galicia, Spain, as an immigrant laborer, but eventually became a landowner. Castro attended Jesuit schools in Santiago de Cuba and later entered the Jesuit Colegio Belen, a preparatory school in Havana. In 1945, Castro began his studies in the Faculty of Law of the University of Havana, where he soon became president of the University Students' Federation. In 1947, Castro joined a force that was training to overthrow the dictatorship of Rafael Trujillo in the Dominican Republic, but it was disbanded by the Cuban government after only a few months in training. Later, in 1948, Castro participated in a violent uprising in Colombia, known as the Bogotazo , while he was attending a student congress there.
After becoming a lawyer in 1950, Castro spent much of his time defending the poor. As a member of the liberal Partido del Pueblo Cubano (also known as the Partido Ortodoxo), Castro became a candidate for Parliament in the national elections scheduled for June 1952. In March 1952, however, General Fulgencio Batista overthrew the elected government of President Carlos Prio Socarrás and established a military dictatorship.
Castro reacted to the coup by submitting a petition to the Court of Constitutional Guarantees in which he accused the dictator of having violated the Constitution of 1940. When his petition was rejected, Castro organized a small rebel force of 165, which on 26 July 1953 attacked the Moncada Barracks in Santiago de Cuba, with the hope of provoking a popular uprising in the Oriente province. The attack was a failure; about half of the rebels were killed and most of the rest were captured, including Fidel Castro and his brother Raúl. During his trial, Castro defended himself by giving a speech that later would become known by the phrase, "History will absolve me." Castro was found guilty and sentenced to 15 years in jail.
In 1955 Castro was released under a general amnesty. For a period of time, he tried to present a nonviolent opposition to the regime, but was denied access to the mass media. Unhappy with the situation in his country, Castro left for Mexico where he organized the "26th of July" movement with Cuban exiles who were anxious to return to Cuba and overthrow the Batista dictatorship.