Anti-Gaddafi fighters have been forced to pull back from the desert town of Bani Walid after meeting barrages of rockets and sniper fire from those loyal to the ousted Libyan leader.

Further to the east, forces backing the interim government surged into Moamar Gaddafi's hometown Sirte, another remaining Gaddafi stronghold.

National Transitional Council (NTC) fighters came under heavy shelling and gunfire after entering Bani Walid, 140 kilometres south-east of Tripoli.

Diehard Gaddafi forces fired barrages of rockets and mortars, repelling the assault by NTC fighters who raced back out of the interior desert town in pick-up trucks.

A Gaddafi spokesman said loyalist fighters have inflicted heavy losses on forces of Libya's new rulers and are prepared for a long fight.

"The battle is far from over," Moussa Ibrahim told Syrian-based Arrai television.

"We have prepared ourselves for a long war. We have the equipment and the weapons."

Many anti-Gaddafi fighters were killed or captured in Bani Walid, he said.

The NTC said its fighters made a "tactical withdrawal" due to sniper fire.

"It is useless to hold on to positions overnight in a hostile environment," a commander told AFP.

An AFP photographer reported his driver seeing around a dozen ambulances streaming out of Bani Walid containing NTC casualties.

It was not immediately known how many had been killed or wounded.

But at Gaddafi's the city of Sirte on the coast, the NTC forces closed in on pockets of resistance scattered across the city.

Hundreds of soldiers rode into the battle on tanks or pick-ups mounted with guns but by nightfall, pockets of Gaddafi loyalists were still resisting with sniper fire from within the city.

"Gaddafi's troops are between the houses, there are a lot of snipers on the roofs," NTC fighter Mabrook Salem said.

"We attack them with rockets, it makes a lot of damage but it is the best way to control them."

NTC fighters, mostly from the port city of Misrata, said they captured Sirte airport with very little resistance and had started using it as a base.

Many Gaddafi supporters had fled the city already.

Senior military commander Salem Jeah said NTC forces were nearing the centre of Sirte, with an AFP correspondent reporting that the frontline was about one kilometre away.

"We are advancing in from the west and the south towards the city centre," Mr Jeah said.

"Our forces retreated strategically during the night but are now speeding towards the centre and some have already entered."

Emergency worker Mohammed al-Ashraf said 10 NTC fighters were wounded and one killed in September 1 Street, where there was heavy fighting.

UN seat

An anti-Gaddafi fighter mans a checkpoint, 1km north of Bani Walid. ( Reuters: Zohra Bensemra )

On the political front, officials in Tripoli said a new transitional government would be announced on Sunday, while the UN General Assembly gave Libya's UN seat to the former rebel National Transitional Council.

Gaddafi and members of his inner circle have been in hiding since Tripoli was overrun, with the fugitive strongman still believed to be in Libya even though members of his family have fled to Algeria and Niger.

One of them, Gaddafi's son Saadi, is being held in Niger, where the government said he would not be sent back "where he has no chance of receiving a fair trial and where he could face the death penalty."

AFP/Reuters