Under
Gamal Abdel Nasser's administration, Mahgoub took part in the preparatory committee and also participated in the
Socialist Union as an official representing the universities. On 21 November 1959, he was appointed a member of the Socialist Union's Executive Bureau for the Cairo Governorate. In 1962 when he was selected to the membership of the charter preparation committee. In the national congress of 1962 he said: "Those who fear freedom are the fiercest enemies of freedom. Fear of freedom is an unforgivable crime". According to his interview in 1984 his disagreement with Nasser's administration was over the freedom of the university. He withdrew from political action in May 1967 and went to
Beirut where he worked as a professor at the
Arab University of Beirut from 1968 until 1970 in the School of Economics. Purging the government, political and security establishments of the
Nasserists,
Anwar al-Sadat invited Mahgoub to take part in the
Infitah policy phase and he took a series of teaching positions at
Cairo University, eventually becoming dean of the faculty of Economics and Political Sciences in 1971. On 2 October 1972, he was appointed by then President
Anwar al-Sadat minister for presidential affairs. On 25 May 1975, he was appointed chairman of the committee supervising the restructuring of the Socialist Union's organizations, beginning with the bottom bases. Also in 1975, he was appointed deputy prime minister. But later he withdrew from political action again because of the methods of Sadat's administration. In 1977, Mahgoub drafted for Sadat a memorandum entitled "The New Course of the Open-door Intellectual, Political and Economic Policy". Later he had the opportunity to supervise the establishment of the
Multi-party system. 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 House of Representatives, a position he held until his assassination on 12 October 1990. ==Death==