After hours of gunfire and explosions in the Libyan capital, Tripoli, the country's leader Muammar Gaddafi says his supporters have eliminated what he called rats who had infiltrated the city.
A rebel official said the uprising had begun in Tripoli as their forces push towards the city on three fronts.
In a state television broadcast, Colonel Gaddafi accused the rebels of being bent on destroying Libya.
And he said many of the blasts heard during the night were caused by fireworks, celebrating victory over what he called "rats" reports the BBC.
A BBC correspondent reports that the most intense period of fighting came at around 11pm but the level of gunfire had reduced by Sunday morning.
One of the sons of the Libyan leader, Seif al-Islam Gaddafi, says his father will not abandon the fight and will win in the battle against rebel forces.
Seif al-Islam Gaddafi says the government is prepared to resist for as long as it takes.
But he also held out an olive branch, telling the rebels if they want peace, his father's regime is ready to talk with them.
Rebels have been fighting pro-Gaddafi forces since February, inspired by uprisings in Tunisia and Egypt which toppled the presidents of those countries.
In the latest battles, rebels have consolidated their hold on the key cities of Zlitan, east of Tripoli, and Zawiya to the west. However pro-Gaddafi forces have been striking back at the oil port of Brega, the BBC said.
Rebel advances on Tripoli have cut off the capital from its main road link to the outside world and put pressure on Colonel Gaddafi.
Meanwhile, the Libyan leader has suffered two more apparent defections.
Former prime minister Abdel Salam Jalloud is believed to be making his way to Europe from Tunisia.
He helped Colonel Gaddafi come to power in 1969 but fell out with him in the 1990s, the BBC reports.
Libyan oil minister Omran Abukraa failed to return from a visit to Italy and instead went to Tunisia.
Senior ministers, army officers and staff at Libya's UN mission in Geneva are among those to defect in the past few months.