Libya's parliament passed a law on Sunday banning officials from the Gaddafi era from holding political office.
The vote in the General National Congress (GNC) comes a week after heavily armed protestors surrounded the Foreign and Justice ministries demanding that the legislature pass the law.
They had said they would not leave until the bill was passed.
The political isolation law could exclude current senior members of government, including Prime Minister Ali Zeidan.
Both Mr Zeidan and GNC speaker, Mohamed Megaryef, were diplomats before the revolution.
The law, which would be implemented by a committee that would decide whether officials fall under the exclusion criteria, goes into effect in 30 days.
However, the law has already come under fire from international human rights groups, who say the measure is too sweeping.