The vizier was the highest official in ancient Egypt to serve the pharaoh (king) during the Old, Middle, and New Kingdoms.The viziers were often appointed by the pharaoh. During the 4th Dynasty and early 5th Dynasty, viziers were exclusively drawn from the royal family; from the period around the reign of Neferirkare Kakai onwards, they were chosen according to loyalty and talent or inherited the position from their fathers.