Muammar Gaddafi's forces have won control of the Libyan town of Zawiyah near Tripoli after intense fighting in which rebel lines were blasted by tanks and artillery, a resident said by phone today.

"The town is now under the army's control," said the resident, who asked to remain anonymous.

"The fighting ended last night. Today the situation is calm. I'm taking the opportunity to leave the town with my family. I'm heading for Jedayem," he added, referring to a small village three kilometres west of Zawiyah.

The prosperous dormitory town 40 kilometres west of Tripoli had been under assault for several days by Gaddafi's forces using artillery and tanks.

Rebels had overrun the town, where many military officers have their homes, soon after a popular uprising against Gaddafi erupted on February 15.

Late yesterday, Libyan government spokesman Mussa Ibrahim said Zawiyah had been retaken but added, "There are still pockets of violence. There have been celebrations for hours."

State television reported that "massive demonstrations" took place in the centre of Zawiyah in favour of Gaddafi last night.

"The crowds in Zawiyah have come out on to the main square in solidarity with our brother, the leader of the revolution," said the television, which has previously reported government successes that were belied on the ground.

It showed pictures of crowds shouting and waving green flags, which it said came from Zawiyah.

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.