After Sadat's assassination at the hands of Islamic militants, Mahgoub was invited to join the new administration. In February 1984, he announced his accession to the National Party and its Parliamentary Committee. In July 1984, he was elected speaker of the Egyptian parliament.