TRIPOLI, Libya -- A defiant Moammar Gadhafi vowed Wednesday to fight on "until victory or martyrdom," as rebel fighters tried to end scattered attacks by regime loyalists in the nervous capital.
The rebels say they have now taken control of nearly all of Tripoli, but sporadic gunfire could still be heard Wednesday, and Gadhafi loyalists fired shells and assault rifles at fighters who had captured the Libyan leader's personal compound one day earlier.
The streets of the city were still largely deserted Wednesday, scattered with debris, broken glass and other remnants of fighting, while rebel fighters manned checkpoints every few hundred yards.
Rebel leaders, meanwhile, made their first moves to set up a new government in the capital. During Libya's six-month civil war, opposition leaders had established their interim administration, the National Transitional Council, in the eastern city of Benghazi, which fell under rebel control shortly after the outbreak of widespread anti-regime protests in February.
"Members of the council are now moving one by one from Benghazi to Tripoli," said Mansour Seyf al-Nasr, the Libyan opposition's new ambassador to France. He said that Tripoli is "secure and our guys are checking all the areas."
The deputy rebel chief, Mahmoud Jibril, was to meet later Wednesday with French President Nicholas Sarkozy, one of the earliest and staunchest supporters of the Libyan opposition, along with British Prime Minister David Cameron.
Even as his 42-year-old regime was crumbling around him, Gadhafi vowed not to surrender. In an audio message early Wednesday, he called on residents of the Libyan capital and loyal tribesmen across his North African nation to free Tripoli from the "devils and traitors" who have overrun it.
The broadcast came a day after hundreds of Libyan rebels stormed Gadhafi's fortress-like Bab al-Aziziya compound in the capital but found no sign of the longtime leader. Late Sunday, the rebels entered Tripoli, pouring into the Mediterranean metropolis of some 2 million people in a stunning breakthrough.
On Wednesday morning, rebel fighters said they still did not have full control of Bab al-Aziziya. Mohammed Amin, a field commander, said regime loyalists continued to fire into the complex.
At one point, rebel fighters came under fire and briefly took cover, some running and others speeding toward the gate in pickup trucks, then returned. Shells were also fired at the complex.
It's not clear where the shooting originated, but Amin said holdouts among regime loyalists have entrenched themselves in areas near the compound.