Libya has announced on Tuesday plans to clear the capital Tripoli of militia groups operating outside its control, following a deadly clash last week that killed more than 40 people.

As a first step, the authorities would try to determine exactly how many militias are operating in Tripoli, their sizes and the weapons they hold, Agence France-Presse reported.

Once that is accomplished, the militias would then be removed from the capital, disarmed and their men integrated into the security forces, which has long been sought by the government.

The European Union is also helping Libya with a 65-day operation to push the militias at least 30 kilometers away from Tripoli.

“The militias must stay at least 30 kilometers away from Tripoli, and the goal is to secure the capital from inside and this is to protect it from extremists and al-Qaeda affiliates from entering the city,” Koert Debeuf, a representative of the EU liberals told Al Arabiya News.

“The militias must disarm if they want to enter Tripoli or they can join the police forces if they want to keep their weapons,” said Debeuf, who was the former advisor to the Belgian prime minister.

On Tuesday, dozens of police were deployed on the capital’s streets as residents continued to demonstrate against the militias on the third day of a general strike called for by the city government, the Associated Press reported.

On Monday, the army deployed troops to the capital in what was the first show of state control there since the overthrow of Muammar Qaddafi in 2011.

Residents have given the troops a warm reception, ululating, clapping and flashing V-for-victory signs in support. Some marchers Tuesday chanted: “Libya is not (war) booty,” the Associated Press reported.

The Misrata militia, which was at the heart of the weekend violence in which 46 people died and some 500 were wounded, already started pulling out of the city on Monday at the behest of community leaders in their city, on the Mediterranean coast.

EX-rebels like those from Misrata, as well as the western city of Zintan, control parts of Tripoli.

Former rebels helped topple and kill veteran dictator Qaddafi, but have since banded into militias carving their own fiefdoms, each with its own ideology and regional allegiance.

The country’s interim parliament has also questioned Prime Minister Ali Zidan over the violence and pressed the government to take action against the militias.

Zidan’s grilling comes after he flew to Misrata on Monday for talks with city council officials and militia commanders, according to privately owned al-Nabaa TV.

There were unconfirmed reports he was forced out of the meeting after disgruntled militiamen gathered outside the building, according to the Associated Press.