From 1659, these African cities, although nominally part of the Ottoman Empire, were in fact military republics that chose their own rulers and lived by war booty captured from the Spanish and Portuguese.