Leaders in Bani Walid have complained that the country’s new rulers have marginalized them because of their loyalty to the old government. Theirs is hardly the only complaint of neglect or retaliation. Other loyalist cities have been left in ruins, with little hope of recovery, or have been stripped of residents accused of treason.

There has been no investigation into the killing of Colonel Qaddafi, nor into the deaths of dozens of his loyalists who were found executed as the rebels celebrated the end of the dictatorship. A local council member from Bani Walid said the city was seeking to participate in the government but refused to be humiliated by Misurata, which has frequently been accused of trying to dominate the post-Qaddafi order.

But some of Libya’s new leaders say that Bani Walid has endured as a stronghold of resistance to the new government.

“Bani Walid is becoming a center of opposition, and for people wanted for their crimes during the war of liberation,” said Abdulrahman Sewehli, a member of Parliament from Misurata.

The latest fighting began with a search for wanted men. In July, fighters from Bani Walid were implicated in the kidnapping of a young man from Misurata named Omran Shaaban, who was with the group of men who claimed to have found Colonel Qaddafi hiding in a drainage pipe as he tried to flee his pursuers in October 2011.

Mr. Shaaban was held in Bani Walid for two months and, according to Misurata’s leaders, was tortured; he died while being treated in a Paris hospital. Confronted with the killing of a favorite son, leaders in Misurata demanded a response from the government, and the Libyan Parliament issued an order to arrest those responsible. Political leaders say the assault on Bani Walid is a government operation that includes militias from all over the country. But Bani Walid’s leaders say the attack is dominated by fighters from Misurata.

“It’s miserable,” said the member of Bani Walid’s local council, who requested anonymity for fear of retribution by Misurata’s fighters. He said the militias were shelling the city with heavy artillery. “I can’t count the number of injured. Every day is worse.”