Fighters loyal to fugitive dictator Moamar Gaddafi have launched fierce counter-attacks against rebel fighters trying to capture the key towns of Sirte and Bani Walid.

Around 20 people were killed as Gaddafi's forces launched surprise attacks on three fronts.

Rebels backed by NATO warplanes launched an assault on Bani Walid but it appears they were led into an ambush by enemy fighters disguised as rebels.

So far the rebels have lacked the strength to overpower the pro-Gaddafi forces, who also launched surprise attacks near Sirte and on an oil refinery at Ras Lanuf, which has been under rebel control.

As the fighting raged, a defiant Gaddafi vowed to fight until victory.

"It is not possible to give Libya to the colonists again," and "all that remains for us is the struggle until victory and the defeat of the coup," Gaddafi said in a statement read out on Syria-based Arrai Oruba television.