TRIPOLI, Libya (AP) — A number of Libyan militias refused to back down on Monday from their protests outside government buildings, despite passage of a sweeping law that bans anyone who served as a senior official under Moammar Gadhafi from working in government.

The militiamen, some manning machine guns mounted on trucks, had been pushing for the law’s passage. But some still remained outside the Justice and Foreign Ministry buildings, where several raised signs demanding the resignation of Prime Minister Ali Zidan.

Days ahead of the vote on the law, militias had also banned government employees at both buildings from work.

The prime minister, who was a member of Libya’s first freely elected parliament before being chosen by fellow liberal lawmakers to lead the government, has been in a confrontation with militias for months.

The continued siege of government buildings highlights Zidan’s inability to rein in the armed groups and exposes the many obstacles the North African nation faces in rebuilding its weak central government.

Zidan’s options, though, are limited in dealing with the militias.

Most militias have roots in the rebel groups that fought Gadhafi in the country’s eight month civil war, but their numbers have mushroomed in the two years since his fall. Some militias have been accused of rights abuses, but the government continues to rely on them for security in the absence of a strong police or military.

For months after Gadhafi’s ouster, militias protected Tripoli’s international airport, provided border security and ensured the country did not spiral out of control.

Many of the wounded fighters complained they could not find proper health care despite millions of dollars allocated for them in the aftermath of the war. Cabinet officials were blamed for corruption and Libyans looked to parliamentary elections for change.

However, the elections brought forth a new crop of politicians, many of them former technocrats under Gadhafi. Though most had defected and joined the opposition years before the uprising began, many of the militias’ fighters and others saw them as having served enough time in Gadhafi’s brutal regime to be considered tainted.

Reda Yaacoub el-Nageh, a spokesman for one of the militias outside the ministry buildings, told The Associated Press that while most gunmen have withdrawn, some are remaining outside until new justice and foreign ministers are named.

Others said they would only leave when Zidan resigns.

The militias have named seven ministers they want replaced, including the interior and defense.

Support for the militias was on display Sunday when thousands of Libyans in Tripoli celebrated in the streets after the controversial law was passed, waving the country’s new flag that was the symbol of rebel fighters during the devastating civil war. Before the vote, protesters had placed images of people killed in the war on empty coffins laid outside parliament, a message that Gadhafi-era officials were not welcome in government.

Yet some activists lamented the passing of the Political Isolation Law at gunpoint, under pressure from militias who want to oust Zidan from power. A Friday march in Tripoli against militia impunity was attacked by supporters of the armed groups.

Rashad Mahdi, a 53-year-old resident of Marzuq in southern Libya, said the demonstration by militias was impeding progress and affecting the country’s return to normalcy.

“People are weary of entering into another conflict and so are refusing to clash with the gunmen,” he said. “We don’t know how this will end.”

There have been efforts to recruit the militias into the army and police force, but the groups continue to operate largely with impunity outside of state control.

Senior military officers have recently joined soldiers in protesting Youssef Mangoush, the army’s chief of staff tasked with bringing militias under government control.

Zidan, who is popular among many, has angered the militias by calling on them to join the government’s security forces. He has vowed to take a hardline stand against armed groups that do not fall in line.

He also threatened to summon outside help to confront the militias, language that prompted the armed groups to besiege Zidan in his office earlier this year. His chief of staff was also briefly abducted by unknown gunmen in April.

Of 200 lawmakers, just 115 voted in favor of the article that had the most sweeping language about what kind of positions could be banned from government posts. The rest of the articles in the bill, including setting a time limit of 10 years for barring a person from government, obtained an overwhelming majority of yes votes.

Liberal politician Mahmoud Jibril, whose parliamentary bloc won the most seats in parliament, could be affected under the new law for having served as an ambassador under Gadhafi.

Some who voted for his coalition say the bloc has done little to improve security or the economy since, and some militiamen consider Jibril a Gadhafi-era figure, despite his role in the revolution as the opposition’s political leader.