As a commander in the Ottoman army he had overthrown the Mamelukes, Egypt’s ruling military caste, by 1811. Although technically the viceroy of the Ottoman sultan, he was effectively an independent ruler and modernized Egypt’s infrastructure, making it the leading power in the eastern Mediterranean. In 1841 he and his family were given the right to become hereditary rulers of Egypt, and the dynasty survived until 1952.