This article lists national heads of government and heads of state who held an active military rank while in office. Note that in many countries, the head of state office has an ex officio military rank; for example, the President of the United States is commander-in-chief of the armed forces. This list omits ex officio ranks. Africa Algeria Houari Boumediene (colonel) (in office 1965–1976) Khaled Nezzar (major general) (in office 1992–1994) Benin Christophe Soglo (colonel) (in office 1963–1964, 1965–1967) Alphonse Alley (lieutenant colonel) (in office 1967–1968) Maurice Kouandété (lieutenant colonel) (in office 1967–1968) Paul-Émile de Souza (colonel) (in office 1969–1970) Mathieu Kérékou (major→general) (in office 1972–1991) Burkina Faso Sangoulé Lamizana (major general) (in office 1966–1980) Saye Zerbo (colonel) (in office 1980–1982) Jean-Baptiste Ouédraogo (major) (in office 1982–1983) Thomas Sankara (captain) (in office 1983–1987) Blaise Compaoré (captain) (in office 1987–2014) Gilbert Diendéré (brigadier general) (in office 2015) Burundi Michel Micombero (colonel→lieutenant general) (in office 1966–1976) Jean-Baptiste Bagaza (colonel) (in office 1976–1987) Pierre Buyoya (major) (in office 1987–1993) Central African Republic Jean-Bédel Bokassa (colonel→marshal) (in office 1966–1979) André Kolingba (major general→general) (in office 1981–1993) François Bozizé (general) (in office 2003–2005) Chad Félix Malloum (brigadier general) (in office 1975–1979) Comoros Combo Ayouba (colonel) (in office 1995) Azali Assoumani (colonel) (in office 1999–2002) Republic of the Congo Marien Ngouabi (major) (in office 1969–1977) Joachim Yhombi-Opango (brigadier general) (in office 1977–1979) Denis Sassou-Nguesso (colonel→general) (in office 1979–1992) Egypt Mostafa Fahmy Pasha (lieutenant general) (in office 1891–1893) Muhammad Naguib (major general) (in office 1953–1954) Gamal Abdel Nasser (colonel) (in office 1954–1970) Anwar El Sadat (colonel) (in office 1970–1981) Hosni Mubarak (air chief marshal) (in office 1981–2011) Mohamed Hussein Tantawi (field marshal) (in office 2011–2012) Equatorial Guinea Teodoro Obiang Nguema Mbasogo (brigadier general) (in office 1979–present) Ethiopia Aman Andom (lieutenant general) (in office 1974) Tafari Benti (brigadier general) (in office 1974–1977) Mengistu Haile Mariam (lieutenant colonel) (in office 1977–1991) The Gambia Yahya Jammeh (colonel) (in office 1994–1996) Ghana Joseph Arthur Ankrah (lieutenant general) (in office 1966–1969) Akwasi Afrifa (brigadier) (in office 1969–1970) Ignatius Kutu Acheampong (colonel→general) (in office 1972–1978) Fred Akuffo (lieutenant general) (in office 1978–1979) Jerry Rawlings (flight lieutenant) (in office June–September 1979, 1981–1992) Guinea Lansana Conté (colonel→general) (in office 1984–1991) Moussa Dadis Camara (captain) (in office 2008–2009) Sékouba Konaté (brigadier general) (in office 2009–2010) Guinea Bissau João Bernardo Vieira (general) (in office 1980–1994) Ansumane Mané (brigadier general) ((in office May 1999) Veríssimo Correia Seabra (general)