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.