Mohamed al-Megaryef, the president of Libya's top political body, resigned on Tuesday to comply with a new law banning Kadhafi-era officials from government jobs.
"Everyone must obey the law out of respect for legality and democracy. I tender my resignation... in conformity with the law," Megaryef told a plenary session of the General National Congress.
Megaryef was Libya's ambassador to India in the 1980s under the regime of now slain dictator Moamer Kadhafi before he defected to become a leader of the exiled opposition for three decades.
"I leave with my head held high and my conscious clear," said Megaryef, who stressed he was the first of Kadhafi-era officials to conform to the law.
The GNC passed the law on May 5 under pressure from gunmen who had surrounded the foreign and justice ministries for days to press the government to sack Kadhafi-linked officials.
Many of the gunmen were former rebels who helped topple Kadhafi and were hailed as heroes for their actions during Libya's 2011 revolution.
Kadhafi, who ruled Libya with an iron fist for four decades, was killed in the armed uprising.
The former rebels have since formed militias with different ideologies and motivations. Today they stand accused of many of Libya's ills, notably the instability that still plagues parts of the North African nation.
Megaryef criticised those in Libya who use weapons to push their agendas, saying it undermines the government's efforts to rebuild the country and achieve democracy.
A member of the national assembly said a new president of the General National Congress was due to be elected soon to replace Megaryef.
But independent MP Abdullah al-Gamati warned that Megaryef's departure would create "a vacuum" because "there is no one in the Congress who the charisma to replace him".
"Megaryef's resignation could have heavy consequences and disrupt the transition," in Libya, he told AFP.
Signup to our newsletter and follow us on Facebook and Twitter!
Several MPs are in favour of a decision to exempt Megaryef from abiding by the law banning Kadhafi-era official, he said.
The law, which comes into force on June 5, bans officials who served under Kadhafi between September 1, 1969 and the fall of his regime in October 2011.
Several other members of the Congress and administration officials are also expected to quit their jobs in compliance with the law.
But Tarek Mitri, who heads the UN mission in Libya, warned that his would undermine state institutions and empty them of "experienced" people.
"Part of the worry... regarding the consequence of this law is the fact that it will deprive state institutions from some experienced and competent persons, who would be very difficult to replace," said Mitri.
"I think there is disagreement on the number of people that would be affected by this law and therefore the impact this will have on government institution," he added,
Legal experts and politicians have also denounced the law, saying it was "unfair" to ban certain politicians who even if they had served under Kadhafi, had joined opposition ranks and battled the regime.
"A nation which does not recognise the sacrifices made by its children is a nation that practices collective injustice one which commits a carnal sin against... the future," Megaryef said after announcing his resignation.
Megaryef was elected to head the GNC last August following Libya's first post-uprising polls the previous month.
A Britain-educated economist, he was born in 1940 in the eastern city of Benghazi, the cradle of the uprising that toppled Kadhafi.
He spent 31 years in exile, including 20 years as a political refugee in the United States. Along with other dissidents, he founded an opposition group that had tried to overthrow Kadhafi.
During his exile he was hunted by Kadhafi's intelligence services, who had launched a campaign in 1980 to liquidate his opponents.