Mubarak became the Vice-President of the Republic of Egypt after moving up the ranks of the Egyptian Air Force. Then he became the President after President Anwar Sadat was assassinated on 6 October 1981. His almost thirty-year presidency made him Egypt's longest-serving ruler since Muhammad Ali Pasha.