Gleeful rebels ransacked Gaddafi's Bab al-Aziziya bastion, seizing weapons and smashing symbols of a government whose demise will transform Libya and send a warning to other Arab autocrats facing popular uprisings.
Gaddafi said his withdrawal from his headquarters in the heart of the capital was a tactical move after it had been hit by 64 NATO air strikes and he vowed "martyrdom" or victory in his fight against the alliance.
Urging Libyans to cleanse the streets of traitors, he said he had secretly toured Tripoli.
"I have been out a bit in Tripoli discreetly, without being seen by people, and ... I did not feel that Tripoli was in danger," Gaddafi said.
He was speaking to pro-Gaddafi media outlets and his whereabouts after leaving the compound remain a mystery, although he appeared to have been in Tripoli, at least until recently.
As night fell on Tuesday after a day in which rebels overran Tripoli, meeting little resistance with few casualties, heavy fighting was reported in a southern desert city, Sabha, that rebels forecast would be Gaddafi loyalists' last redoubt.
Forces loyal to Gaddafi were shelling the towns of Zuara and Ajelat, west of Tripoli, Al-Arabiya television reported.
"Volcano of lava"
In Tripoli itself, Reuters correspondents said there still appeared to be some hostile fire around the city centre as darkness descended and looting broke out.
Omar al-Ghirani, a spokesman for the rebels, said loyalist forces had fired seven Grad missiles at residential areas of the capital, causing people to flee their homes in panic.
He told Reuters Gaddafi forces had also fired mortar rounds in the area of the Tripoli airport.
The continued shooting suggested the six-month popular insurgency against Gaddafi, a maverick Arab nationalist who defied the West and kept an iron hand on his oil-exporting, country for four decades, had not completely triumphed yet.
A spokesman for Gaddafi said the Libyan leader was ready to resist the rebels for months, or even years.
"We will turn Libya into a volcano of lava and fire under the feet of the invaders and their treacherous agents," Moussa Ibrahim said, speaking by telephone to the pro-Gaddafi channels.
Rebel leaders would not enjoy peace if they carried out plans to move to Tripoli from their headquarters in the eastern city of Benghazi, he said.
But Gaddafi was already history in the eyes of the rebels and their political leaders planned high-level talks in Qatar on Wednesday with envoys of the United States, Britain, France, Turkey and the United Arab Emirates on the way ahead.
Another meeting was scheduled for Thursday in Istanbul.
"It's over! Gaddafi is finished!" yelled a fighter over a din of celebratory gunfire across the Bab al-Aziziya compound, Gaddafi's sprawling citadel of power in the Libyan capital.
Keep revolution clean rebel leader says
Opinion was divided about Gaddafi's whereabouts. Colonel Ahmed Bani told Al-Arabiya TV that rebels believed Gaddafi was probably holed up in one of many hideouts in Tripoli. "It will take a long time to find him," he said.
Rebel National Council chief Mustafa Abdel-Jalil, who was until February a loyal minister of Gaddafi, cautioned: "It is too early to say that the battle of Tripoli is over. That won't happen until Gaddafi and his sons are captured."
Mahmoud Jibril, head of the rebel government, promised a transition toward a democracy for all Libyans. "The whole world is looking at Libya," he said, warning against summary justice.
"We must not sully the final page of the revolution."
Jibril said they had formed a new body including field commanders from a variety of local revolutionary groups to coordinate security. There is a long history of friction among villages and tribes, Arabs and ethnic Berbers, and between the east and west of a state formed as an Italian colony in 1934.
Western powers who backed the revolt with air power held off from pronouncing victory although they are keen for a swift return to order, given fears that ethnic and tribal divisions among the insurgents could degenerate into the kind of anarchy that would thwart hopes of Libya resuming oil exports.
But the fall of Gaddafi, with the arresting images on Arab satellite TV of rebels stomping through his inner sanctum and laying waste to the props of his long unaccountable domination, could be a shot in the arm for other revolts in the Arab world.
It could underline that entrenched authoritarian leaders are no longer invincible, particularly in Syria where popular unrest has widened despite ever fiercer military crackdowns by President Bashar al-Assad.
At the Bab al-Aziziya, long a no-go area, armed men broke up a gilded statue of Gaddafi, kicking its face. Others ripped up his portrait or climbed on a monument depicting a clenched fist, which Gaddafi erected after a U.S. air strike in 1986.
Another rebel sported a heavily braided, peaked military cap of a kind favoured by the colonel, who seized power in 1969. He said he had taken the hat from Gaddafi's bedroom.
"House to house! Room to room!" chanted some men at Bab al-Aziziya, calling for a search of its bunkers and tunnels in a mocking echo of the words Gaddafi used six months ago when he vowed to crush the early stirrings of the Arab Spring revolt.
Abdel Hakim Belhadj, a rebel commander, said he did not know where Gaddafi or his sons were. "They ran like rats."
British Foreign Secretary William Hague said: "We're in the death throes of this regime ... But it's still a very difficult and dangerous time. It's not over yet."
On Tuesday night, youths danced in Tripoli's Green Square, another Gaddafi showpiece arena. They waved the red, green and black flag of the rebels to the sound of gunfire, though most of the city's 2 million people prudently stayed indoors.
One man greeted the fall of a third autocrat in the Arab Spring and forecast others would share their fate: "1. Tunisia 2. Egypt 3. Libya ? Syria ? Yemen," his sign read.
Rebel officials, who said they hoped to move from Benghazi in the east to the capital this week, spoke of trying Gaddafi in Libya rather than sending him to The Hague, where he and two others have been indicted by the International Criminal Court.
The Russian head of the International Chess Federation, who had visited Tripoli in June, told Reuters Gaddafi called him on Tuesday to say he would stay in Tripoli and "fight to the end".
But he had few places to make a stand. His home town of Sirte, on the Mediterranean coast between Tripoli and rebel Benghazi, was expected to welcome rebel forces shortly, Abdel-Jalil said. But Jibril spoke of a need still to "liberate" southern desert areas such as Sabha and of fighting there.