|Al Jazeera has acquired rare footage of Gaddafi troops in action in Ajdabiya in March
Forces loyal to Muammar Gaddafi, the Libyan leader, have shelled rebel positions west of Ajdabiya.
There are reports the town is on the brink of falling to Gaddafi troops, in a major setback for rebels who earlier in the day had pushed westward towards Brega.
Our correspondents, citing reliable sources, said gun battles were taking place in the streets of Ajdabiya on Saturday.
As his troops engaged rebels in new fighting, Muammar Gaddafi made his first television appearance in five days. He was last seen on April 4.
Gaddafi smiled and pumped his fists in the air as he received an ecstatic welcome at a school in Tripoli, where women ululated and pupils chanted anti-western slogans.
On the battlefront, Al Jazeera's Hoda Abdel-Hamid, who had to turn back about 20 kilometres from Ajdabiya because of the shelling, said the town was being pounded from the north, south and west.
"Reliable military sources told us that Gaddafi's forces managed to advance overnight from the southern desert and started shelling from that area.
"We are also told that there is street fighting going on inside Ajdabiya between rebels and Gaddafi loyalists. This is a very serious development because there is now fighting on two fronts – around Ajdabiya and around Brega."
Mohammed Idris, the supervisor at Ajdabiya hospital said at least eight rebels were killed and nine people, including two civilians, were injured during the shelling by government troops and the subsequent gunbattle with rebels in the streets.
The Reuters news agency said the blasts and gunfire were heard for 30 minutes from near the western boundary of the town, which is the gateway to the opposition stronghold of Benghazi in the country's east.
"They are bombarding the western gate [of Ajdabiya]," a rebel said.
At least 10 loud explosions were heard near the outskirts of the town.
Fear and anger
Our correspondent said there was a lot of anger on the ground as rebel fighters failed to hold their ground against the advancing forces on Gaddafi's side.
Al Jazeera's Hoda Abdel-Hamid reports from Brega
on how the rebels are struggling to hold their ground
"The advance by government troops and how they quickly can adapt to impediments is a clear indication that the opposition fighters are not able to hold ground.
"There is a lot of anger among them. The atmosphere has completely changed on the frontlines. The media is not as welcome as it used to be. There is a lot of anger at NATO and at the international community."
Abdel-Hamid added that there was also the fear that Gaddafi's forces may be able to infiltrate cities, prevent NATO air strikes on military targets, and somehow turn the fighting into guerrilla warfare.
AFP reported that the pro-Gaddafi forces were shelling the rebels as they retreated, and that the attack came after the opposition fighters had attempted to make a push towards the oil town of Brega, 80km further west, earlier in the day.
During that push, rebels had allowed foreign journalists to advance to a supply base behind their shortlived frontline halfway to the oil town. They reportedly took two Gaddafi loyalists prisoner near Brega's Bright Star university during the advance.
After the Gaddafi forces' shelling began, dozens of cars and military vehicles were seen leaving Ajdabiya, headed east towards Benghazi using both carriageways of the main highway.
Anti-aircraft guns and rocket-launchers were seen taking up defensive positions at intervals along the highway in order to cover the retreat.
The Associated Press, however, reported that after the pullback, some rebel forces attempted to launch a counteroffensive with heavy machine guns and rockets.
Weapons depot hit
|Click here for more special coverage
NATO air strikes hit weapons depots belonging to Gaddafi's forces near the town of Zintan on Friday, a resident said.
"The depots are situated 15km southeast of Zintan. We could see buildings on fire in the distance," the resident, called Abdulrahman, said by phone.
Amid the fighting, the European Union said on Friday that it was preparing to deploy military assets on humanitarian aid missions in order to evacuate the wounded from Misurata and to deliver food, water and medicine to the town.
The African Union will also be acting in Libya in the coming days, with a group of African leaders due to visit the country on the weekend to meet with government officials in Tripoli and then to conduct talks with the opposition's Transition National Council in Benghazi.
The panel, which includes the leaders of Congo, Mali, Mauritania, South Africa and Uganda, had been scheduled to visit Libya last month but had to cancel the trip after failing to obtain permission to enter the country as Western nations began implementing a no-fly zone.