Militias, many of whom are from Misrata, have been shelling the hilltop town of 70,000 people for several days. Libyan state news agency LANA said late on Saturday 14 people had been killed and 200 injured in the fighting.
Libya's new rulers have led the nation to elections but have struggled to impose their authority on a country awash with weapons. Underscoring the chaos and confusion were conflicting reports over the fate of Gaddafi's former spokesman and his son.
While Misrata spent weeks under siege by Gaddafi forces in last year's war, Bani Walid was one of the towns that remained loyal to Gaddafi longest. It remains isolated from the rest of Libya and former rebels say it still harbours pockets of support for the old government.
"The attacks are continuing," Bani Walid militia leader Abdelkarim Ghomaid said by phone. "The shelling is coming from all sides."
He said Bani Walid fighters had captured 16 cars belonging to militias from Misrata. This could not be immediately independently verified.
Outside Bani Walid, hundreds of vehicles lined up in the village of Weshtata, 80 km (50 miles) from Tripoli, waiting to be checked by government forces as families fled the fighting.
"We are escaping the danger of the rockets, the shrapnel, and the deaths inside. There hasn't been electricity for days," said one man who had his family in a pick-up truck.
Women and children sat in the back of other pick-ups, nestled among blankets, mattresses and bundles of belongings.
CONFLICTING REPORTS
Misrata was enraged by the death of rebel Omran Shaban after two months in detention in Bani Walid. Shaban, from Misrata, was the man who found Gaddafi hiding in a drain pipe in Sirte on Oct. 20, 2011.
Libya's congress ordered the Defence and Interior Ministries to find those responsible for abducting Shaban and suspected of torturing him. It gave Bani Walid a deadline to hand them over.
"Fighting is continuing today. There is smoke rising over certain parts of the city," one Bani Walid resident said by phone.
Hundreds of families have also fled the fighting in Bani Walid to Tarhouna, some 80 km away, where a statement from the prime minister's office on Saturday said militias had captured former Gaddafi spokesman Moussa Ibrahim.
However, in an audio clip posted on Facebook, a person purporting to be Ibrahim, who held regular news conferences in Tripoli during last year's war, dismissed news of his arrest.
There was no independent verification of the authenticity or timing of the Facebook post, dated Oct. 20.
Some officials said Gaddafi's son Khamis had been captured in Bani Walid and died after being taken to Misrata, however there was no official written statement from the government on this, as with previous captures of former regime figures.
On Sunday, Deputy Prime Minister Mustafa Abushagur said on his official Twitter account the announcement of Ibrahim's arrest and Khamis's death was made without confirmation of the news.
No photographs of either Ibrahim or Khamis in detention surfaced after the reports. The government has previously made false allegations regarding the capture of Gaddafi loyalists.
Khamis was reported dead on at least three separate occasions during last year's conflict. A Syrian-based television station that supported Gaddafi said he had been killed in fighting southeast of Tripoli on Aug. 29, 2011.