Libya's defence minister has arrived in Bani Walid, a former stronghold of the Gaddafi regime, after four people were killed in fighting there on Monday.
Osama al-Juwali wants to negotiate with militiamen who drove those loyal to the National Transitional Council into the surrounding desert, officials say.
Locals have told the BBC 90% of the town is under the militiamen's control.
In case Mr Juwali is unsuccessful, NTC forces armed with artillery and rockets have gathered outside, ready to attack.
However, one commander was overheard telling his men that they were there "for the purposes of reconciliation, not fighting".
On Tuesday, the head of Bani Walid's council, Mubarak al-Fatamni, said that forces loyal to the new government were attacked on 23 January in a "barbaric manner" by members of the "remnants of the Gaddafi regime".
Mr Fatamni said the green flag used by Libya during Col Muammar Gaddafi's rule had been flown over the town for a short time on Monday.
But spokesmen for the interim prime minister and defence ministry told the BBC the dispute was a local one, involving rival militias.
Later, Mr Juwali warned that forces loyal to the NTC would "strike with an iron fist" against anyone who posed a threat to Libyan security.
On Wednesday, a member of the local council, Abdul Aziz al-Jumaili, told the Reuters news agency that he had been speaking to the defence minister "to find a solution to this problem".
Mr Jumaili said a "peacekeeping force" comprised of units of former rebel fighters loyal to the NTC and drawn from other towns in the region had set up checkpoints on the outskirts of Bani Walid.
The BBC's Gabriel Gatehouse, who is on the outskirts of Bani Walid, says that for the moment the NTC is describing the recent clashes as a local problem rather than an organised pro-Gaddafi counter revolution.
The NTC says it hopes order can be restored through negotiation, but judging by the force now gathering outside the town it looks like they are keeping their military options open, our correspondent adds.
This is the latest in a series of clashes between rival armed groups, three months after the official end of the revolution that ousted Col Gaddafi.
Earlier this month, armed clashes between militias in the towns of Assabia and Gharyan left 12 dead and about 100 injured.
Libya's interim leader, Mustafa Abdul Jalil, has warned of the dangers of a civil war if the country's militias are not disarmed.