TRIPOLI, Libya -- Under pressure from armed militias, Libya's parliament passed a sweeping law yesterday that bans anyone who served as a senior official under Moammar Gadhafi during his 42-year-long rule from working in government.

The Political Isolation Law could lead to the dismissal of many current leaders, some of whom had defected to the rebel side during the country's 2011 civil war or had been elected to office since Gadhafi's ouster and killing. The move is also likely to further stall Libya's rocky transition to democracy by ousting elected lawmakers.

Liberals say it will boost Islamists, who performed poorly in recent elections compared with their counterparts in other Arab states, although Islamists said they could also be affected by the ban.

advertisement | advertise on newsday

The law was partially driven by the unpopularity of Libya's politicians among many of the still-powerful former rebels who toppled Gadhafi, and others who say little has improved since. Its backers say it is necessary to complete the revolution.

But critics say the law was passed at gunpoint, as militias have surrounded several government buildings in Tripoli for the past several days, barring officials from work. Their vehicles, mounted with rocket-propelled grenades, were on the street during the vote.