Forces loyal to Libya's late leader Muammar Gaddafi have launched a series of attacks across several cities, killing seven fighters who helped topple the former regime, officials and residents say.

The violence on Monday comes 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.

It is not clear if the attacks were co-ordinated.

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