Egypt was always a difficult province for the Ottoman Sultans to control, due in part to the continuing power and influence of the Mamluks, the Egyptian military caste who had ruled the country for centuries.