Security forces loyal to Libyan leader Muammar Gaddafi have used heavy machine guns and mortars to confront lightly armed opposition forces and protesters who took to the streets of Tripoli on Saturday night in anticipation of a final rebel advance on the capital.
Fighting continued into Sunday morning in a few central and eastern neighbourhoods, and rebel flags were raised over some buildings, witnesses said. Much of the population took cover inside their homes.
Gaddafi in an audio message has refused to surrender and pledged to emerge "victorious" from the fighting for Tripoli.
In the message broadcast on state television late on Sunday, he rallied the people of Libya to come from all regions to liberate Tripoli saying he was in the city with them and that together they would fight to the end.
"We will not, we will not abandon Tripoli to the occupants and their agents. I am with you in this battle," he said.
"We do not surrender and, by God's grace, we will emerge victorious." He called on his supporters to "march on (the district of) Tajoura in tens of thousands to purge the officials of the colonisers," in a reference to the NATO-backed rebels.
"Today we must take over Tajoura. I fear, if you let them, they will destroy Tripoli," he warned.
The second message in as many days from the veteran Libyan leader came as rebels launched an assault on the Libyan capital.
Outside of Tripoli, rebel fighters closed in. They advanced tens of kilometres from Zawiyah, to the west, seizing the town of al-Mayah and putting themselves within several kilometres of the capital's suburbs. Other rebel formations remained further way, stationed to the south, in Gharyan, and to the east, in Zlitan.
Despite the greatest challenge yet to his power, Gaddafi remained pugnacious, issuing a telephoned audio address in which he exhorted his followers and congratulated them for defeating the "rats".
His most prominent son, Saif al-Islam, gave a televised speech, saying the regime did not know how to raise the "white flag" of surrender.
Regime uses mortars and anti-aircraft guns
Gunfire and explosions were reported near the Bab al-Aziziyah - a sprawling regime command and control compound - and in the Souq al-Jomaa and Abu Sita neighbourhoods.
Rebels said some regime troops defending the Mitiga air base in the capital had abandoned their posts, though mass defections were not reported.
Taher, a resident near the Bab al-Aziziyah, told Al Jazeera that men in his neighbourhood, some of whom were armed with AK-47 assault rifles and rocket-propelled grenade launchers, had begun protesting last night and blocked the roads.
Around 30 to 40 regime security forces responded on Sunday morning with assault rifles and anti-aircraft guns. Some took positions on the rooftops of the nearby Nigerian Embassy and an eye clinic and opened fire, forcing the men to take cover inside the walled compounds of neighbourhood homes.
Youssef, another Tripoli resident who lives in the Abu Sita neighbourhood, said regime gunmen had taken positions on the top of the nearby Libyana mobile company building and were firing indiscriminately, as other forces launched mortar rounds. The streets in the area were deserted, he said, as occasional gunfire and booming explosions could be heard in the background.
The rebel flag, a tricoloured emblem of the country's first post-colonial days, flew over many buildings in the neighbourhood, he said.
"We are waiting for the revolutionaries to come to conquer Tripoli, because we don't have weapons to defend ourselves," he said.
"Gaddafi troops are using heavy artillery and heavy weapons, and we don't know what's going to
happen in the next two to three hours."
Government said rebels 'dealt with'
Protests began at around 9pm local time on Saturday, as residents took to the streets in numerous areas of the capital, many of them emerging from mosques and chanting "God is great".
Expatriate Libyans speaking to family members in the capital said men went out to protest, some with weapons, while children and women were asked to stay home. Meanwhile, NATO aircraft reportedly carried out bombing raids after nightfall.
In a live audio broadcast aired on state television early on Sunday morning, Gaddafi congratulated his supporters and accused French President Nicolas Sarkozy of trying to steal the country's oil. He said that the rebels were "bent on the destruction of the Libyan people".
Gaddafi urged his supporters to "march by the millions" and end a months-long rebellion, which he termed a "masquerade".
Government spokesman Moussa Ibrahim earlier said rebels had tried to attack Tripoli but had been "dealt with".
Ibrahim said that pro-regime volunteers had repelled attacks in several neighbourhoods. He dismissed mounting speculation that the regime was on the brink, but more gunfire was heard after he spoke on television.
'Operation Mermaid Dawn'
A senior official in the rebel National Transitional Council (NTC) said on Sunday that operations in Tripoli were co-ordinated between opponents of Gaddafi in the city and the rebels in the east.
"The zero hour has started. The rebels in Tripoli have risen up," said Abdel Hafiz Ghoga, vice-chairman of the NTC, in the eastern city of Benghazi.
"There is co-ordination with the rebels in Tripoli. This was a pre-set plan. They've been preparing for a while. There's co-ordination with the rebels approaching from the east, west and south," he said.
Colonel Fadlallah Haroun, a military commander in Benghazi, said the battles marked the beginning of Operation Mermaid Dawn. Tripoli's nickname in Libya is "Bride of the Sea," or mermaid.
Haroun told the AP news agency that weapons were assembled and sent by tugboats to Tripoli on Friday night.
"The fighters in Tripoli are rising up in two places at the moment - some are in the Tajoura neighbourhood and the other is near the Matiga airport," he told Al-Jazeera.
Tajoura has been known since the beginning of the uprising in February as one of the Tripoli neighbourhoods most openly opposed to Gaddafi's rule. The Matiga airport is located in the city, while the international airport is located around 30km south.
A rebel representative for Tripoli on the NTC told AP that rebels were surrounding almost every neighbourhood in the capital, and there was especially heavy fighting in Fashloum, Tajoura and Souq al-Jomaa.
In Benghazi, thousands of Libyans celebrated in the main city square, shooting fireworks and guns into the air, and waving rebel flags.