TRIPOLI, Libya - A new law that excludes former officials of the Moammar Gadhafi era from public office is dividing Libya and deepening the turmoil plaguing the country since the 2011 civil war that ousted the erratic leader.

Passed by parliament Sunday essentially at gunpoint - heavily armed militias were parked outside government buildings and refused to leave until it was approved - the law bans from politics not only those who held office but clerics who glorified the dictator and researchers who worked on his notorious ideological tract, the Green Book.

The measure is one more symbol of the divided society that has emerged after Gadhafi in the oil-rich North African nation, stalling its troubled transition to democracy.

The collapse of central state authority and the already weakened military under Gadhafi has left successive governments without strong and decisive law enforcement bodies and forced them to lean on militias, formed initially from rebel forces that fought Gadhafi, to fill the security vacuum.

Legal experts as well as supporters and opponents of the new law note that it can be overridden if it's not included in a new constitution that has yet to be drafted. The parliament itself is temporary, with its main mission being the formation of a panel to write the charter that will result in new elections.

According to a time frame set by the transitional government during the eight-month civil war, the new constitution was supposed to have been drafted by November 2012. But the process stalled amid a struggle between two factions in parliament - a group of mostly Islamists and their rivals over formation of the Cabinet.

In the meantime, many senior politicians and former Gadhafi-era officials who defected to the rebel side may lose their posts.

After the militia groups ended their siege of government buildings, Prime Minister Ali Zidan promised a Cabinet reshuffle and praised them Wednesday as "revolutionaries."

He said his government would look into the backgrounds of all senior officials and fire those banned by the new law.

Anyone with ties to the former regime would be barred for 10 years from state institutions, including the military, police, judiciary, local councils and universities.