He served from 1972 to 1977 as head of the board of auditors at the Libyan Arab Republic's Revenue Court, where he proved uncomfortable for the regime because of his anti-corruption stance and was subsequently designated Libya's Ambassador to India.
Subsequent to the founding of the National Front for the Salvation of Libya, el-Magariaf is one of few people who knew he was targeted by Gaddafi's bombing of UTA Flight 772 in 1989.
[9] After serving as President for 9 months he resigned in May 2013 in anticipation of the political isolation law which was passed, barring him from office due to his previous role as an ambassador under the Gaddafi regime.
[16][17] He had been visiting the town with a GNC delegation as part of a fact-finding mission aimed at helping the government restore security and crack down on smuggling operations in the south of the country.
Magarief told reporters that his hotel was attacked by gunmen, triggering a three-hour gun battle with his personal bodyguards in which three of them were injured.
Magariaf is reported to have good relations with the Muslim Brotherhood, yet is perceived as a moderate pragmatist who led one of the most liberal parties in the 2012 election.