But many Libyans feel Bani Walid, 110 miles southeast of Tripoli, was never truly "liberated" and see it as a shelter for regime loyalists and criminal gangs.

The hilltop town came back into focus last month after the death of a former rebel from the city of Misurata who was credited with capturing Gaddafi and was later kidnapped, allegedly tortured and shot in Bani Walid.

The death of former rebel Omar ben Shaaban, 22, stoked tensions between Misurata and Bani Walid, neighbouring but historically rival cities which found themselves on opposite sides of the 2011 conflict.

The General National Congress (GNC), the highest political authority, ordered the defence and interior ministries on September 25 to find those who held him hostage for weeks in Bani Walid and authorised the "use of force if necessary."

Acting on the national assembly's order, army troops and brigades made up of ex-rebels encircled Bani Walid in early October and threatened to "purge" former regime remnants.

On Wednesday, Shield Libya officers and fighters from the city of Misurata said that they had received orders to advance into Bani Walid but the army's spokesman, Colonel Ali al-Sheikhi, swiftly denied this.

"We gave no order to attack," Sheikhi told AFP, adding that the authorities wanted to give a chance for negotiations to succeed.

Later, the chief of staff said in a statement carried by the official news agency LANA that the army was in fact "ready to enter Bani Walid."

The statement called on "all parties to exercise self-restraint" so that "units of the regular army can impose the authority of the state."

Last week, tribal chiefs interviewed by AFP in Bani Walid said that they would refuse the entry of "lawless militias" into the town and stressed that there was no such thing as an army in Libya.

The new authorities, under pressure to rebuild the army and police force, have had a hard time controlling dozens of militias made up of former rebels.