This book explores the life of el-Hajj Beshir Agha (ca. 1657-1746), the most powerful Chief Harem Eunuch in the history of the Ottoman Empire. In this capacity, he helped to shape and propagate the official Ottoman brand of Sunni Islam. El-Hajj Beshir was one of hundreds of East African eunuchs who served as guards and interlocutors for the imperial mothers, sisters, wives, and concubines who inhabited Topkapy Palace's enormous harem. Enslaved in his native Ethiopia as a boy, then castrated in Egypt, Beshir may initially have been purchased by one of Egypt's grandees before being introduced into the palace. Once installed in the palace, he quickly rose through the ranks of harem eunuchs to become harem treasurer by 1707. Following a brief period of exile in 1713-1714, he served as chief of the eunuchs who guarded the Prophet Muhammad's tomb in Medina--a peculiar institution inaugurated in the twelfth century and abolished only in the twentieth. Recalled to Topkapy Palace in 1717, el-Hajj Beshir spent the next thirty years overseeing the educations of crown princes and harem women while choosing and deposing a long series of grand viziers; in the process, he survived a major rebellion that resulted in the execution of a grand vizier and the deposition of a sultan. In his capacity as superintendent of the imperial pious foundations for the Holy Cities of Mecca and Medina, he amassed an empire-wide network of clients. Meanwhile, the mosques, theological schools, sufi lodges, and libraries that he founded throughout the empire helped to shape the religious and intellectual profile of the Ottoman state.