Forces loyal to former Libyan leader Muammar Gaddafi have launched a series of attacks across several cities in the country.

The violence came as Libya's new leaders struggle to stamp out lingering resistance from pro-Gaddafi forces and try to unify a deeply fractured country after eight months of civil war and more than 40 years of authoritarian rule.

The attacks were spread out and took place in the western city of Bani Walid, the capital Tripoli and the eastern city of Benghazi, the city where the uprising against Gaddafi started nearly a year ago.

Violence broke out first in Bani Walid, where pro-Gaddafi fighters have long tormented Libya's revolutionaries.

Mahmoud al-Warfali, a spokesman for the revolutionary brigade in Bani Walid, said at least four of his fighters were killed in the western city, which was one of the last former regime strongholds to fall to revolutionary command.

He said up to 150 pro-Gaddafi fighters were engaged in the street battle, using rocket-propelled grenades and AK-47s. He said they managed to raise the green Libyan flag of Gaddafi's regime at the northern gate of the town.

"These are Gaddafi remnants who tried to take over the city," Mr al-Warfali said. "They have tried to do this before and take over the interim government's office, but thank God we have been able to fight them off."

Hours later, three fighters were killed by pro-Gaddafi forces in Benghazi. The city served as the hub for revolutionary leaders during the civil war.

Abdel-Rahman al-Soghayar, a commander from the new regime in Tripoli, said shooting also took place in several neighbourhoods of the capital, forcing people to remain indoors and stores to close early. He blamed the gunfire on "sleeper cells" loyal to Gaddafi who he said are attempting to take advantage of the fighting in Bani Walid.

The bold attacks are the latest breakdown in security, three months after Gaddafi's capture and killing. Protests have surged in recent weeks, with people demanding that the interim leaders deliver on promises of transparency and compensation for those injured in the civil war.

The new government's promises to deliver justice for those killed in the uprising has been usurped in some areas by revolutionary fighters taking retribution on their own.

Bani Walid resident Moussa al-Warfali said the clashes erupted after revolutionary forces arrested a Gaddafi loyalist, whose comrades launched an attack to free him.

The fighting originally was centred on the revolutionary brigade's base, then spread to other parts of the town.

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.