Several hours later pro-Gaddafi media quoted him as saying he had abandoned the compound in a "tactical withdrawal" after it was wrecked by NATO bombing attacks.
The speech gave no indication of where he had gone.
The attack on the Bab al-Azizya compound followed three days of fighting in the capital which the head of the rebel National Transitional Council, Mustafa Abdel Jalil, said had left more than 400 killed and 2,000 wounded.
Without specifying if he was talking of both sides, Jalil told France-24 television that some 600 pro-Gaddafi fighters had been captured but the battle would not be over until the Libyan leader himself was a prisoner.
Celebratory gunfire rocked the city when news spread that the insurgents had breached the walls of compound in the centre of the capital and had sent Gaddafi's forces fleeing.
But Gaddafi loyalists still held out in parts of the city, and were in control of the Rixos Hotel, headquarters of some 30 foreign journalists accredited to the regime, preventing any of them from leaving.
Jalil also said three areas of the capital were still resisting, including Abu Slim, from where half-a-dozen mortar bombs fell on Bab al-Azizya late yesterday.
Rebels said Gaddafi loyalists in his birthplace of Sirte, the last major regime bastion remaining, had fired a missile at rebel-held Misrata, hours after negotiations began to try to secure a surrender of the city.
In the rebels' eastern base of Benghazi, where residents too poured onto the streets in celebration, military spokesman Colonel Ahmed Omar Bani said there had been no trace of Gaddafi or his family in his compound.
"Bab al-Azizya is fully under our control now. Colonel Gaddafi and his sons were not there; there is nobody," Bani said. "No one knows where they are." An AFP correspondent saw rebels breach the surrounding cement walls of the vast complex and pour inside, where the bodies of a number of apparent Gaddafi fighters were lying, as were wounded people.
As rebel leaders proclaimed they had "won the battle," fighters in the compound fired automatic weapons into the air, chanting "Allahu Akbar" (God is greatest) and raiding the armoury for ammunition, pistols and rifles.
Rebels were seen ripping the head off a Gaddafi statue, stepping on it and kicking it. One young man, a green bandana around his head, picked it up and held it above his head like a trophy, flashing a huge smile.
Another climbed on a huge sculpture of a fist gripping an aeroplane -- a symbol of a US attack on the compound in 1986 -- trying to break off a piece.
The fighting for Gaddafi's headquarters was the most intense in the city since rebel fighters in their hundreds came surging into the capital three days ago.
On the eastern front, Libyan rebels yesterday overran the eastern oil hub of Ras Lanuf on the road to Sirte, spokesman Bani said.
The assault on Bab al-Azizya came only hours after GadDafi's son, Seif al-Islam, appeared at the compound to refute reports that he had been arrested by the rebels.