Libyan rebel fighters celebrate after seizing control of the Gaddafi army women's officer training center in Tripoli's Qarqarsh district August 22, 2011.

By Missy Ryan and Ulf Laessing

(Reuters) – Muammar Gaddafi was a hunted man on Monday as loyal remnants of his forces made a last-ditch stand in the capital and world leaders embraced the fractious Libyan rebels as new masters of the oil-rich North African state.

Nearly 48 hours after a pincer thrust on Tripoli by the irregular rebel armies, launched in tandem with an uprising in the city, Gaddafi’s tanks and sharpshooters appeared to hold only small areas, including his Bab al-Aziziya headquarters.

Civilians, who mobbed the streets late on Sunday to cheer the end of dictatorship, stayed indoors as gunfire crackled. Gaddafi’s prime minister showed up in Tunisia. State television went off the air and rebels said they had seized its transmitters.

More Libyan embassies abroad hoisted the rebel flag.

Western powers who deployed air power in support of various rebel groups in different regions, urged the “Brother Leader” to accept his 42 years of absolute power were over, and to end the bloodshed after six months of civil war that has ebbed and flowed erratically across the sparsely populated desert nation.

French President Nicolas Sarkozy, who took an early gamble on the Libyan rebels, called on Gaddafi loyalists “to turn their back on the criminal and cynical blindness of their leader by immediately ceasing fire, giving up their arms and turning themselves in to the legitimate Libyan authorities”.

President Barack Obama said: “Muammar Gaddafi and his regime need to recognize that their rule has come to an end.”

Egypt, whose Arab Spring revolt inspired its neighbors, abandoned its caution and recognized the rebel government. Other beleaguered Arab revolutionaries, notably in Syria, may take heart from a hard-fought triumph in the sands of Libya.

Laila Jawad, 36, who works at a Tripoli nursery, told Reuters after the rebels swept into the city: “We are about to be delivered from the tyrant’s rule. It’s a new thing for me.

“I am very optimistic. Praise be to God.”

With international competition already heating up for Libyan oil, Russia and China, critics of the West’s assault on Gaddafi, also indicated he should bow to the now inevitable.

But after a defiant audio address on Sunday, urging citizens to take up arms against rebel “rats”, no more was heard from a man who is one of the world’s longest ruling leaders and who vowed do die fighting rather than surrender.

Various officials said they did not know where he was.

SONS DETAINED

Two of Gaddafi’s sons were detained, including Saif al-Islam who has been indicted with his father for crimes against humanity. Two other sons, Khamis and Mutassim, were reported by Arab media to be with those still fighting.

Gaddafi’s prime minister, Al Baghdadi Ali al-Mahmoudi, arrived late on Sunday on the Tunisian island of Djerba — a favored location for defectors and negotiators from Tripoli. Local sources could give no account of what he was doing there.

A rebel official in the eastern city of Benghazi, seat of the opposition National Transitional Council, said some of its representatives had slipped in to Tripoli in recent days to make contact with authorities hitherto loyal to Gaddafi with the aim of averting a breakdown of order in the capital.

There have been concerns that tribal, ethnic and other 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. However, the presence of former Gaddafi aides in the rebel camp is cited by some as cause to hope the opposition can prove more inclusive than that in Iraq.

NTC head Mustafa Abdel Jalil, who was Gaddafi’s justice minister until joining the revolt in February, told a news conference in Benghazi: “I call on all Libyans to exercise self-restraint and to respect the property and lives of others and not to resort to taking the law into their own hands.”

Reuters correspondents saw rebel forces hunt sharpshooters from building to building. Sporadic gunfire and shelling kept civilians off the streets, waiting anxiously for the fighting to end after a brief outpouring of jubilation late on Sunday.

“Revolutionaries are positioned everywhere in Tripoli,” said a senior rebel in the city, who used the name Abdulrahman.

“But Gaddafi’s forces have been trying to resist.

“There is gunfire everywhere,” he added, saying government tanks were in action near Tripoli’s Mediterranean port and downtown near Gaddafi’s Bab al-Aziziya compound. “Snipers are the main problem,” he said. “There is a big number of martyrs.”

A government official told Reuters 376 people on both sides were killed, and about 1,000 wounded, though it was unclear how the figures were arrived at. At the Rixos Nasr hotel, where the government had obliged foreign reporters to stay throughout the war, pro-Gaddafi guards prevented journalists from leaving.

South Africa, a leading power on the continent to which Gaddafi devoted much of Libya’s wealth and influence, denied it had sent a plane for Gaddafi or was planning to shelter a leader who has been indicted for crimes against humanity by the International Criminal Court in The Hague.

Sweden’s Prime Minister Fredrik Reinfeldt said: “We are watching history.” But he cited the bloody epilogue to the overthrow of Saddam Hussein in Iraq and warned: “There is a risk for actions of revenge, and uncontrollable violence.”

STRUGGLE FOR OIL

The national council’s Jalil said it would favor foreign countries that had supported the rebellion — a potential blow to the likes of Chinese and Russian oil companies, though they are not the only ones to have cut deals with Gaddafi.

Western governments had competed for the veteran ruler’s favor in recent years after negotiating a grudging resolution to decades of conflict, during which Gaddafi’s “anti-colonial” campaigns saw him support a range of armed groups from the Palestinians to the IRA and take responsibility for the downing of an American airliner over Lockerbie in Scotland in 1988.

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.

POPULAR REJOICING

Civilians had flocked late on Sunday to Green Square, long the showpiece of the leader’s personality cult, waving rebel flags. Some said they would rename it Martyrs’ Square.

Young men burned the green flags of the government and raised the rebel tricolor last used by the post-colonial monarchy which Gaddafi overthrew in a military coup in 1969.

But on Monday, a Reuters correspondent with rebels moving in from the west watched commanders of the irregular force try to hold their men back from rushing ahead in the city, insisting they check buildings methodically for snipers.

It was slow work and there will little sign of coordination between rebel units. The all-green flags of the Gaddafi government were still hanging in many streets — an indication that rebels did not feel safe enough to rip them down.

“We just arrived and our priority is to secure the city,” said Hisham Bourajad, a commander of what he described as the Tripoli Revolutionary Brigade as his force probed forward.

Only five months ago, Gaddafi’s forces were set to crush the rebel stronghold of Benghazi. He warned then that there would be “no mercy, no pity” for his opponents.

His forces, he said, would hunt them down “district to district, alley to alley, house to house, room to room”. It is a refrain some rebels have thrown back at him in recent days.