BANI WALID, Libya Forces loyal to Libya's government took control of the former Gaddafi stronghold of Bani Walid on Wednesday, commanders said, after weeks of fighting that have underlined the weakness of central authority more than a year after Libya's revolution.
Pro-government fighters shouted "Bani Walid is free!" as pick-up trucks mounted with weapons poured into the centre of the isolated hilltop town, one of the last to surrender last year to the rebels who toppled Muammar Gaddafi.
Thousands have this month fled the bloodshed between rival militias, and pockets of resistance were still reported on Wednesday on the outskirts of Bani Walid, some 170 km (105 miles) south of Tripoli.
Bent on making their mark on a town they say still harbours many of the late dictator's followers, pro-government forces fired rocket-propelled grenades and anti-aircraft weapons at empty buildings.
Heavy gunfire thundered non-stop and smoke billowed over part of the town.
The fighters cried "Allahu Akbar!" (God is Great) and "Today Bani Walid is finished!", honking car horns and blasting patriotic music from their trucks.
Some of them climbed onto the roof of one building to hoist Libya's tricolour flag and then fired their rifles in the air.
Posters of Shaban as well as historical Misrata hero Ramadan al-Swehli hung atop one town-centre building. But next to it, a coffee shop stood empty with its plastic chairs still outside, and residents were notably absent from main streets.
"BANI WALID IS FREE"
"On this day - October 24 - Bani Walid is free. There are no more Gaddafi militias inside," said Fathi Shahoud, a commander of Libya Shield, a grouping of militias operating under the umbrella of the Defence Ministry. "Now we control the city and we will stay to ensure safety."
Tarek Nouri Abu-Shabi, a 21-year-old member of the Free Libya militia, said: "The revolutionaries have been in control since yesterday. These are rebels from Misrata, Tripoli and from other places. There are still small pockets of fighting on the outskirts. We found weapons inside the town."
Pro-government forces moved on Bani Walid this month after Omran Shaban, the fighter who found Gaddafi hiding in a drain in Sirte two months after rebels took Tripoli, died following two months of detention in the town.
The standoff highlighted the Tripoli government's inability to reconcile groups with long-running grievances, as well as its failure to bring many of the militias that deposed Gaddafi fully under its control.
The pro-government militias set out to find those suspected of abducting and torturing Shaban, and the national congress gave Bani Walid a deadline to hand them over.
"The military act is now finished. We now are working to make the city stable and more secure," army chief of staff Youssef al-Mangoush told reporters. "That doesn't mean that there isn't some resistance here or there. Now the government is in charge."
He said the pro-government forces had freed a number of people from detention and captured some fighters who used to belong to Gaddafi's son Khamis's brigade.
According to the Libyan state news agency, the clashes in Bani Walid killed at least 22 people and injured hundreds. Thousands of families fled, saying there was no water or electricity in the city and a shortage of food and medicine.
There were unconfirmed reports on Tuesday of retribution by pro-government forces.
"The militias have entered the suburbs with bulldozers and have begun to demolish homes without reason," Abdel-Hamid Saleh, a member of a Bani Walid civil society group, said by phone.
"A woman called me yesterday screaming 'They have come for me, they have come for me' in fear. The city is falling on our heads."
The Bani Walid General Hospital was evacuated this week when, according to residents, it came under a rocket and mortar barrage.
"The patients have been moved to hiding places, homes and mosques because they were under fire in the hospital," tribal elder Mohammed al-Shetwai told Reuters.
A Reuters team was unable to reach the hospital on Wednesday because of widespread shooting.
The International Committee of the Red Cross said it had previously delivered surgical supplies to treat around 100 patients wounded by shooting inside the city, as well as other urgently needed medical supplies.
(Additional reporting by Hadeel Al-Shalchi; Writing By Marie-Louise Gumuchian and Hadeel Al-Shalchi; Editing by Kevin Liffey)