While fighting flared up again on the war's only active frontline, a Red Cross ship brought medical supplies to the besieged western city of Misrata, scene of bitter street battles, where conditions are said to be desperate.
Gaddafi's forces shelled the western outskirts of Ajdabiyah, launch point for rebel attacks towards the Mediterranean oil port of Brega.
A Reuters correspondent heard artillery impacts and machinegun fire for around 30 minutes, coming from the western boundary of the town, the gateway to the rebel stronghold of Benghazi 150 km (90 miles) to the northeast.
Al Jazeera television said Gaddafi forces had entered Ajdabiyah.
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. One woman cried with emotion as he passed.
Gaddafi, wearing his trademark brown robes and dark glasses, was last seen on television on April 4.
He looked confident and relaxed, confirming the impression among analysts that his administration has emerged from a period of paralysis and is hunkering down for a long campaign.
Inconclusive see-saw battles have raged along the desert road between Brega and Ajdabiyah for over a week after Gaddafi's military pushed back a rebel advance.
Western generals are increasingly pessimistic that the military stalemate can be broken despite NATO air attacks on Gaddafi's armoured forces.
A Red Cross ship managed to dock in Misrata on Saturday carrying enough medical supplies to treat 300 patients with gunshot wounds.
Misrata, the lone major rebel outpost in the west of Libya, has been under siege by Gaddafi's forces for weeks. Insurgents said on Friday they had repelled an assault on the eastern flank of the city after fierce street battles that killed five people.
Misrata, Libya's third largest city, rose up with other towns against Gaddafi in mid-February after a security crackdown snuffed out most peaceful protests in the west.
Rebels say people in Misrata are crammed five families to a house in the few safe districts to escape weeks of sniper, mortar and rocket fire. There are severe shortages of food, water and medical supplies and hospitals are overflowing.
The rebels said they intended to take Brega on Saturday and some had penetrated the outskirts.
"God willing, we will take Brega today. We already have people up there and we will try to do it today," said rebel Captain Hakim Muazzib from a petrol station on the desert road between the two towns. There were 10 pick-up trucks waiting in the petrol station, carrying rocket launchers and machineguns.
Abdullah Mutalib, 27, a rebel lying in a hospital bed in Ajdabiyah with a bullet wound in his side, told Reuters: "Some of us got inside Brega to the university, some got to the outskirts. Then we came under rocket fire."
NATO air strikes hit weapons depots belonging to Gaddafi forces near Zintan, south of Tripoli, on Friday, a resident said.
"The depots are situated 15 km (nine miles) southeast of Zintan. We could see buildings on fire in the distance," the resident, called Abdulrahman, said by phone.
An oil tanker carrying 80,000 tonnes of crude that the rebels need to finance their uprising entered the Suez Canal on Saturday after leaving rebel-held east Libya.
Traders say it is heading for China with the first cargo the rebels have sold.
Western officials have acknowledged that their air power will not be enough to help the rag-tag rebels overthrow Gaddafi by force and they are now emphasising a political solution. NATO air strikes, with the stated aim of protecting civilians against Gaddafi's army under a U.N. mandate, have created rather than broken a stalemate with neither side now strong enough to land a knockout blow.
Alliance officials have expressed frustration that Gaddafi's tactics of sheltering his armour in civilian areas has diluted the impact of supremacy in the skies over Libya.
Analysts predict a long, low-level conflict possibly leading to partition between east and west in the sprawling country.
"The opposition forces are insufficient to break this deadlock and so as things stand, the march on Tripoli is not going to happen," said John Marks, chairman of Britain's Cross Border Information consultancy.
"This standoff looks like it could go on pretty much forever ... for now we have a stalemate so we are looking rather more at a de facto partition."