The longest-serving non-royal head of state in the 20th and 21st centuries was Fidel Castro, who held the titles of Prime Minister of Cuba, First Secretary of the Integrated Revolutionary Organizations, First Secretary of the Central Committee of the United Party for the Socialist Revolution of Cuba, First Secretary of the Central Committee of the Communist Party of Cuba, President of the Council of State, and President of the Council of Ministers of the Republic of Cuba. He served overall for 52 years, 2 months, and 3 days but was only head of state from 1976 to 2008 (31 years, 2 months and 22 days).