Libyans living in Turkey wave a flag of the Kingdom of Libya during a protest against Libyan leader Gaddafi outside the Libyan embassy in Ankara
Libyans living in Turkey wave a flag of the Kingdom of Libya during a protest against Libyan leader Gaddafi outside the Libyan embassy in Ankara Reuters

Remnants of forces still loyal to Muammar Gaddafi staged a desperate stand in Tripoli on Tuesday as rebels fought their way into the capital, but the whereabouts of the veteran leader was a mystery.

World leaders urged Gaddafi, 69, to surrender to prevent more bloodshed and appealed for an orderly transition of power, as the six-month-old battle for control of the oil-producing North African nation appeared to enter its final stages.

Rebels say they are now in control of most of Tripoli, a sprawling coastal city of two million people on the Mediterranean Sea, but it was not clear whether Gaddafi was still in the Libyan capital.

Rebels swept into Tripoli two days ago in tandem with an uprising within the city. Reuters reporters saw firefights and clashes with heavy weapons, including anti-aircraft guns, as rebels tried to flush out snipers and pockets of resistance.

Hundreds seem to have been killed or wounded since Saturday. But Gaddafi tanks and sharpshooters appeared to hold only small areas, mainly around Gaddafi's heavily fortified Bab al-Aziziyah compound in central Tripoli.

Civilians, who had mobbed the streets on Sunday to cheer the end of dictatorship, stayed indoors as machinegun fire and explosions punctuated some of the heaviest fighting of the Arab Spring uprisings that have been reshaping the Middle East.

U.S. President Barack Obama, saying the conflict was not over yet, cautioned rebels against exacting revenge for Gaddafi's brutal rule. True justice will not come from reprisals and violence, he said.

The president also made plain that the United States would oppose any group within the loose coalition of rebels from imposing its power over other parts of Libyan society.

Above all we will call for an inclusive transition that leads to a democratic Libya, Obama said.

In an audio broadcast on Sunday before state TV went off the air, Gaddafi said he would stay in Tripoli until the end. There has been speculation, however, he might seek refuge in his home region around Sirte, or abroad.

In a sign Gaddafi allies were still determined to fight, NATO said government forces fired three Scud-type missiles from the area of Sirte toward the rebel-held city of Misrata.

Bab al-Aziziyah, a huge complex where some believe Gaddafi might be hiding, was the focal point of fighting in Tripoli.

NATO warplanes bombed the compound in the early hours of Tuesday, al-Arabiya television reported citing rebel sources.

I don't imagine the Bab al-Aziziyah compound will fall easily and I imagine there will be a fierce fight, Abdel Hafiz Ghoga, spokesman for the rebel National Transitional Council, said in an interview aired by Al-Jazeera.

Al-Jazeera television, quoting its correspondent, said violent clashes were also reported near the oil town of Brega.

Rebels said they held three of Gaddafi's sons, including his heir apparent Seif al-Islam. Al-Jazeera TV said that one of them, Mohammed, had escaped, adding that the body of another son, military commander Khamis, might have been found along with that of powerful intelligence chief Abdullah al-Senussi.

FEARS OF REPRISAL, REVENGE

Western powers are concerned that tribal, ethnic and political divisions among the diverse armed groups opposed to Gaddafi could lead to the kind of blood-letting seen in Iraq after the overthrow of Saddam Hussein.

In a move that could ease tensions, a rebel official in the eastern city of Benghazi said, however, that efforts were under way to make contact with authorities hitherto loyal to Gaddafi.

Foreign governments which had hesitated to take sides, among them Gaddafi's Arab neighbors, Russia and China also made clear his four decades of absolute power were over.

A U.S. State Department spokeswoman said Libyans claiming to represent Gaddafi were making more desperate efforts to negotiate with the United States in the last 24 to 48 hours.

Washington did not take any of them seriously because they did not indicate Gaddafi's willingness to step down, she added.

French President Nicolas Sarkozy, who took an early gamble on the rebels and may now reap diplomatic benefits, called on the Gaddafi loyalists to turn their back on the criminal and cynical blindness of their leader by immediately ceasing fire.

Late on Monday, Sarkozy spoke to Britain's David Cameron by telephone about the Libya situation, according to a press release from the French presidential palace.

They both agreed to pursue efforts in supporting the legitimate Libyan authorities as long as Colonel Gaddafi refuses to surrender arms, the statement read. Paris has offered to host a summit on Libya soon.

Cameron also spoke to Obama on Monday night.

GADDAFI'S WHEREABOUTS A MYSTERY

Gaddafi's whereabouts remained a mystery as rebels streamed into his former stronghold of Tripoli. He has not been seen in public since mid-June.

In Iraq's case in 2003, Saddam managed to slip away from Baghdad and hide from U.S. forces in Iraq for eight months.

It was less clear that Gaddafi, unsure of loyalty even among his own tribe, could find refuge. However, he has had access to vast wealth and his Bab al-Aziziyah compound in Tripoli covers a network of blastproof tunnels and bunkers which are assumed to include escape routes.

Western leaders reiterated their refusal to commit military forces to peacekeeping in Libya, which could mean tackling rearguard loyalists using urban guerrilla tactics.

NATO has backed the revolt with air power but eschewed the ground combat that cost U.S. lives in Iraq and Afghanistan.

Britain's International Development Secretary Andrew Mitchell told the BBC there was no possibility of British military involvement being expanded in Libya.

We do not see any circumstances in which British troops would be deployed on the ground in Libya, he said.

But some governments have had civilian advisers in Benghazi for months, and the swift military advance of recent days revived questions about the shadowy role of foreign special forces on the ground.

First signs emerged of moves to begin restoring oil production that has been the foundation of the economy and a source of hope for Libya's six million, mostly poor, people. Staff from Italy's Eni arrived to look into restarting facilities, said Foreign Minister Franco Frattini.

Italy, Libya's nearest European neighbor and the colonial power until World War Two, is a big customer for Libyan energy. But it will face stiff competition from others seeking a share of Libya's wealth -- a competition some fear could test the ability of untried rebel leaders to hold the country together.