Libya's new flag flew at the United Nations on Tuesday for the first time since Muammar Gaddafi's overthrow as U.S. President Barack Obama called for the last of the deposed leader's loyalists to stop fighting.

International leaders at a high-level U.N. conference on Libya congratulated Libyans -- and themselves -- for Gaddafi's removal by NATO-backed rebels in a seven-month-old conflict.

U.N. Secretary-General Ban Ki-moon, welcoming Libya's new leaders into the international community, said the Security Council had acted to protect the Libyan people from violence.

Today, we must once again respond with such speed and decisive action -- this time to consolidate peace and democracy, Ban added.

Libya has reverted to the national flag that was used from 1951 until Gaddafi, who ruled for nearly 42 years, introduced a green flag for his Libyan Arab Jamahiriya, or people's republic, in 1977.

Libya's new rulers, finally recognized on Tuesday by the African Union, are still trying to dislodge well-armed Gaddafi loyalists from several towns and have yet to start a countdown toward writing a new constitution and holding elections.

They face questions about whether they can unify a country divided on tribal, regional and ideological lines.

Mustafa Abdul Jalil, president of Libya's ruling National Transitional Council (NTC), promised a spirit of tolerance and reconciliation and appealed for international assistance to help his country emerge from conflict and build democracy.

Today, the Libyan people are writing a new chapter in the life of their nation, Obama said, announcing the return of the U.S. envoy to Tripoli. We will stand with you in your struggle to realize the peace and prosperity that freedom can bring.

Those still holding out must understand -- the old regime is over, and it is time to lay down your arms and join the new Libya, Obama said nearly a month after Gaddafi was driven from power with the help of a NATO-led bombing campaign.

He further pledged: So long as the Libyan people are being threatened, the NATO-led mission to protect them will continue.

Gaddafi, who is on the run, had taunted the Western alliance in a speech broadcast by a Syrian-based television station on Tuesday, saying: The bombs of NATO planes will not last.

DEFENSE OF LIBYA STRATEGY

Obama also delivered a staunch defense of his Libya strategy. He had faced criticism for an initially slow response to the Libyan uprising and then set strict limits on the U.S. role in the NATO air assault, which was officially justified as a means of stopping the massacre of civilians.

The White House felt vindicated in its approach when rebel forces took Tripoli on August 23. Libya is a lesson in what the international community can achieve when we stand together as one, Obama said. But he insisted that we cannot and should not intervene every time there's an injustice in the world.

Obama, who met earlier with NTC leader Abdel Jalil, said his country would build new partnerships with Libya, a top oil producer, to help unleash its extraordinary potential.

He pushed for swift steps toward democratic reform after decades of authoritarian rule under Gaddafi. We all know what's needed. A transition that is timely, he said. New laws and a constitution that uphold the rule of law ... And, for the first time in Libyan history, free and fair elections.

In Benghazi, interim Prime Minister Mahmoud Jibril failed to win approval for his proposed new cabinet on Sunday.

The political infighting reveals some of the fractures in a leadership that was united in civil war by hatred of Gaddafi but remains split among pro-Western liberals, underground Islamist guerrillas and defectors from Gaddafi's government.

Gaddafi suffered a further diplomatic blow when the African Union (AU) recognised the NTC. It urged the NTC to protect African migrant workers following reports of black Africans being targeted by fighters hunting pro-Gaddafi mercenaries.

South African President Jacob Zuma, whose country had long resisted recognizing Gaddafi's foes, urged the United Nations to lift the NATO-enforced no-fly zone over Libya soon, echoing a similar call by Russia last week.

A U.N. spokesman said international donors and organizations would meet later on Tuesday to establish a Libya Recovery Trust Fund under the NTC's leadership to back rebuilding efforts.