Ex-rebels allied to Libya's army attacked a bastion of diehards linked to slain dictator Moamer Kadhafi in clashes that left at least 11 dead, underlining the challenges facing the government.
Wednesday's fighting came exactly a year after anti-regime forces declared the liberation of Bani Walid, 170 kilometres (110 miles) southeast of Tripoli,
But many still see it as a shelter for regime loyalists and criminal gangs.
"Bani Walid was shelled from three fronts today," said Massud al-Waer, a town official. He told AFP that dozens of residents were wounded in the assault, which has been under siege for weeks.
The commander of the ex-rebel group, Libya Shield, said four of his men had been killed and 19 wounded in the fighting for the hilltop town, which remained loyal to Kadhafi during the 2011 conflict that led to his ouster.
The deputy director of Bani Walid's hospital, Abdullah al-Mansuri, told AFP that his facility had received another "seven dead people and 75 wounded, including a 14-year-old girl."
The town came back into focus last month after the death of a former rebel from the city of Misrata who was credited with capturing Kadhafi and was later kidnapped, allegedly tortured and shot in Bani Walid.
The death of Omar ben Shaaban, 22, stoked tensions between the neighbouring towns which found themselves on opposite sides of the 2011 conflict.
Libya's national assembly, elected in July, ordered the defence and interior ministers to find those who held him hostage for weeks in Bani Walid and authorised the use of force if necessary.
The army chief of staff said Wednesday in a statement carried by the official news agency LANA that the army was "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 said they did not recognise a military authority in Libya.
The weeks-long standoff underlines the challenges facing the authorities in Tripoli suppressing dozens of militias comprising disparate former rebels as they seek to rebuild the army and police force.