Libyan army troops have swept into the capital in an operation to drive out militiamen after days of violence.

Monday's deployment in Tripoli was the most assertive yet by the military, but the government's armed forces and police remain weak and under-equipped and rely on allied militias for firepower.

Essam al-Naas, spokesman from the Joint Operation Room, a security body under the prime minister, said that as the military deployed, militias from the western city of Misrata withdrew from their positions in four districts of the capital and returned to their city.

Sporadic gunfire was heard in eastern Tripoli, in an area called Wadi al-Rabie, or the Spring Valley, when members of the Misrata militia fired on a Tripoli-based militia that was demanding they surrender their weapons before leaving, al-Naas said. There was no immediate report of casualties.

Libyans' anger was stoked when militiamen opened fire last Friday on an anti-militia protest in Tripoli, killing at least 43 people. Protesters were demanding the removal of militias to allow police and army to be the sole force in the streets. The next day, another militia attacked a military base, sparking clashes that left four dead.

In reaction to public anger against its militias, Misrata's city council decided to withdraw its armed groups from Tripoli but also called on ministers from the city to withdraw from the central government in a show of protest.

It was not immediately clear if the ministers would respond to the order.

Also on Monday, Libya's deputy intelligence chief Mustafa Nouh was released, a day after he was abducted by gunmen as he was leaving the airport in the capital, Tripoli, a security official said.

He later told private television channel Al-Naba that his captors took him to the western city of Zintan.

He did not elaborate on the motives for the kidnapping. Ex-rebels from Zintan, like those from Misrata, control parts of Tripoli.

The US, meanwhile, said it is ready to train Libyan soldiers as part of efforts to boost security.

The training, requested by Libya's prime minister, would be carried out by the military's Africa Command at a base in Bulgaria, a Pentagon spokesman told reporters in Washington.

"We're in discussions with the Libyans on the exact number, but we're prepared to provide training for 5,000 to 8,000 personnel," Colonel Steve Warren said.

Source: Al Jazeera and agencies