Muammar Gaddafi's supporters have put up fierce resistance against offensives trying to storm two strongholds in Libya, forcing revolutionary fighters into retreat in the mountains and turning Gaddafi's seaside home town into a battlefield of snipers firing from mosques and heavy weapons rattling main boulevards.
The tough defence displayed the firepower and resolve of the Gaddafi followers and suggested Libya's new rulers may not easily push aside the remnants of the old regime.
In the mountain enclave of Bani Walid, about 90 miles south-east of Tripoli, revolutionary forces pulled back after a day of intense fighting that failed to dislodge pro-Gaddafi snipers and gunners from strategic positions.
In Sirte, Gaddafi's birthplace on the Mediterranean coast, his backers rained gunfire down from mosque minarets and high-rise buildings on fighters pushing into the city from the west, while in the streets the two sides battered each other with high-calibre machine guns, rockets and rocket-propelled grenades.
"The Gaddafi loyalists have so many weapons," said Maab Fatel, a 28-year-old revolutionary fighter on the front lines in Bani Walid. "This battle is really crazy."
His uniform was splattered with blood from carrying an injured comrade as revolutionary fighters and Gaddafi loyalists traded relentless mortar and rocket fire across a 500-yard desert valley called Wadi Zeitoun that divides the town - and the two sides - between north and south.
Dr Ihab Agha, a field doctor, said at least five rebels were killed and more than 20 wounded, including one fighter who had both legs amputated because of severe injuries.
The twin assaults appeared to be a co-ordinated attempt to break the back of regime holdouts, who still hold a swathe of territory along the central coast and into the southern deserts more than three weeks after revolutionary fighters swept into Tripoli and drove out Gaddafi. The whereabouts of the ousted leader and several of his sons remain unknown.
The new leadership has been gaining international support in their campaign to root out the rest of Gaddafi's regime and establish their authority, with high-profile visits this week by the French president and Prime Minister David Cameron, and today by Turkish prime minister Recep Tayyip Erdogan.
Mr Erdogan joined Friday prayers in Tripoli's Martyrs' Square, the heart of the city once known as Green Square where Gaddafi's regime threw rallies of supporters before his fall. "You have shown the whole world that no one can stand before the power and the will of the people," he said in a speech as thousands cheered.