Libya conflict: NTC forces driven back from Bani Walid
Anti-Gaddafi forces have been forced to pull back from Bani Walid after meeting fierce resistance from those loyal to the ousted Libyan leader.
Fighters came under heavy shelling and gunfire after entering the town, 90 miles (140 kilometres) south-east of the capital Tripoli.
Further to the east, forces are continuing an assault on Sirte, another remaining Gaddafi stronghold.
Earlier, the UN voted to give Libya's seat to the transitional authorities.
The move, which faced only minor opposition, clears the way for National Transitional Council (NTC) chief Mustafa Abdul Jalil to attend the UN General Assembly in New York next week.
US officials say President Barack Obama will meet Mr Jalil on the sidelines of the gathering on Tuesday.
The UN has also passed a resolution to ease sanctions against Libya, including on its national oil company and national bank.
British Foreign Secretary William Hague said about $19bn (£12bn) in Libyan assets frozen in the UK would be gradually released as a result.
Concern for civilians
Shortly after entering Bani Walid, NTC forces were hit by sniper fire, mortar attacks and rocket barrages as they tried to advance on the city centre.
"We have received orders to retreat. We have been hit by many rockets. We will come back later," Assad al-Hamuri, a fighter, told Reuters as forces began their withdrawal.
Correspondents said that not for the first time, anti-Gaddafi forces appeared to be in some disarray, as they were forced to retreat from Bani Walid following an initial advance.
Around Col Gaddafi's hometown, Sirte, there were fierce exchanges as the two sides battled for control.
The BBC's Ian Pannell, in Tripoli, says the latest attacks suggest the battle for the remaining contested areas of Libya could be entering a decisive phase.
But there is concern for the tens of thousands of civilians still believed to be living in both Bani Walid and Sirte, and who have been surviving for weeks with limited access to food, water and electricity, our correspondent adds.
The fresh advance on Bani Walid came after a deadline set by the NTC forces to allow civilians to leave the town expired.
The BBC's Peter Biles, outside Bani Walid, says smoke could be seen from the town and explosions heard, while a number of ambulances have been coming from Bani Walid carrying wounded.
Earlier, soldiers at a checkpoint told him that the driver of Col Gaddafi's son Saif al-Islam has been captured.
In an televised audio message, Col Gaddafi's spokesman said loyalists had inflicted heavy losses on fighters in Bani Walid, and were prepared for a long fight.
"The battle is far from over," Moussa Ibrahim said in comments broadcast on Syria-based Arrai television station.
"We have prepared ourselves for a long war. We have the equipment and the weapons."
"We assure everybody that the Sirte and Bani Walid fronts are strong, despite the heavy, unbelievable and merciless Nato bombardment on hospitals, families and schools," he added, according to Reuters.
'Snipers on roofs'
Meanwhile, columns of NTC fighters backed by tanks launched an early morning assault on the coastal town of Sirte, Col Gaddafi's hometown.
Anti-Gaddafi forces claimed that Sirte airport had been taken from loyalists, while fierce fighting was also reported south-east of the city centre.
"Gaddafi's troops are between the houses, there are a lot of snipers on the roofs," fighter Mabrook Salem told Reuters.
"We attack them with rockets, it makes a lot of damage but it is the best way to control them," he said.
Bani Walid and Sirte are among the last strongholds of those loyal to Col Muammar Gaddafi, after Tripoli fell to NTC forces last month.
In a separate development, the government of Niger has said it will not send Col Gaddafi's son, Saadi, back to Libya, saying there was no guarantee the 38-year-old would receive a fair trial in his home country.
"With regard to (our) international obligations, we cannot send someone back there where he has no chance of receiving a fair trial and where he could face the death penalty," government spokesman Marou Amadou said.
"On the other hand, if this gentleman or any other person is wanted by an independent court... which has universal competence over the crimes for which he is pursued, Niger will do its duty," he added.
The International Criminal Court has issued arrest warrants for Col Gaddafi, his son Saif al-Islam, and former intelligence chief Abdullah al-Senussi, but not for Saadi, a former footballer.
In New York, the UN General Assembly voted in favour of giving Libya's seat to the NTC, despite some opposition from Latin American governments.
The 193-member assembly voted 114 to 17, with 15 abstentions. Some African nations called for a decision to be postponed.
The move allows Mr Jalil to attend the General Assembly meeting.
US officials said Mr Obama would meet Mr Jalil to discuss the NTC's plans for the post-Gaddafi era.
The meeting would allow Mr Obama to "congratulate chairman Jalil on the success of the Libyan people of ending the Gaddafi regime", US deputy security adviser Ben Rhodes told AFP news agency.
France and the US welcomed the UN developments, calling the transfer of the UN seat to the NTC a "historic" step.
"This vote confirms the reintegration of Libya in the concert of nations which is welcoming the representatives of the new Libya," said France's UN ambassador Gerard Araud.