Heavy machine-gun fire erupted early today in the Libyan capital of Tripoli, including in the neighbourhood of Muammar Gaddafi's residence, as hundreds of his supporters poured into the streets in celebration.

Libyan authorities said the unusually heavy gunfire that began around 5.30am was celebratory, claiming government forces had retaken the oil port of Ras Lanouf, in central Libya.

But residents of Ras Lanouf said today that the opposition remained in control of the port.

Around 300 Gaddafi supporters drove passed the Bab al-Aziziya military camp where Gaddafi lives, waving flags and shooting in the air. Armed men in plainclothes were standing at the gates, also shooting in the air. It was not known if Gaddafi was in Tripoli.

The gunfire rattled the capital as the conflict in Libya deepened, signalling an increasingly long and violent battle that could last weeks or months and veered the country ever closer to civil war.

The crisis in Libya has distinguished itself from the other uprisings sweeping the Arab world, with Gaddafi unleashing a violent crackdown against his political opponents, who themselves have taken up arms in their attempt to remove him from office after ruling the country for more than 41 years. Hundreds have been killed.

Gaddafi has drawn international condemnation for his actions. US President Barack Obama has insisted that Gaddafi must leave and said Washington was considering a full range of options, including the imposition of a "no-fly" zone over Libya.

Yesterday, both sides saw gains as they battled for control of the country.

Government forces in tanks rolled into the opposition-held city closest to Tripoli after blasting it with artillery and mortar fire, while rebels captured Ras Lanouf and pushed toward Gaddafi's hometown.

With the Gaddafi regime's tanks prowling the centre of the city of Zawiya, west of Tripoli, residents ferried the wounded from the fierce fighting in private cars to a makeshift clinic in a mosque, fearing that any injured taken to the military-controlled hospital "will be killed for sure", one rebel said.

Rebels in the east advanced from their eastern stronghold toward Sirte, setting the stage for fierce fighting with pro-Gaddafi forces who hold sway in the tribal area.

The storming of Zawiya, a city of some 200,000 people just 30 miles west of Tripoli, began with a surprise dawn attack by pro-Gaddafi forces firing mortar shells and machine guns.

"The number of people killed is so big. The number of the wounded is so big. The number of tanks that entered the city is big," the rebel in Zawiya said. The rebels vowed to keep up the fight in the city.

Witnesses who spoke by telephone with gunfire and explosions in the background said the shelling damaged government buildings and homes. Several fires sent heavy black smoke over the city, and witnesses said snipers shot at anybody on the streets, including residents on balconies.

The rebels initially retreated to positions deeper in the city before they launched a counter-offensive in which they regained some ground, according to three residents and activists.

By mid-afternoon, the rebels had reoccupied central Martyrs' Square while the pro-regime forces regrouped on the city's fringes, sealing off entry and exit routes. Members of the elite Khamis Brigade, named after one of Gaddafi's sons who commands it, have been massed outside the city for days.

The pro-Gaddafi forces then blasted Zawiya with artillery and mortar fire before the tanks and troops on foot came in, firing at buildings and people, witnesses said.

Deputy Foreign Minister Khaled Qaid said "99%" of Zawiya is under government control.

The rebels fared better in the east, capturing the key oil port of Ras Lanouf on Friday night in their first military victory in a potentially long and arduous westward march from the east of the country to Gaddafi's eastern stronghold of Tripoli.

Witnesses said Ras Lanouf, about 90 miles east of Sirte, fell to rebel hands on Friday night after a fierce battle with pro-regime forces who later fled.

"Go to Tripoli!" one of the fighters yelled in English.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.