We develop a model that studies the incentives of the ruling elite regarding the selection of the political leader. We show that it is optimal for the ruling elite to choose leaders with more military experience in a politically unstable regime while more educated leaders are preferred in politically stable regimes. Using a dataset that includes 1569 national leaders from 177 countries over the period 1946-2011, we find empirical evidence that political stability contributes to the selection of more educated leaders, while the reverse holds for leaders with high military ranks. The empirical findings are robust to different subsamples, various proxies for educational and military attainment, and different measures for political stability. Our results suggest that leader selection is another reason why political instability is harmful for economic growth.