Obama told the United Nations General Assembly the international community must work harder in future to ensure states do not implode.
The rapid descent of Libya into violent chaos was one of the most dramatic events in the "Arab Spring," the abrupt collapse of long-standing autocratic governments in a number of Arab countries in the face of popular protests. "Even as we helped the Libyan people bring an end to the reign of a tyrant, our coalition could have and should have done more to fill a vacuum left behind," Obama said.
His rare acknowledgement of mistakes in Libya's transition came as the United Nations tries to negotiate an end to fighting between two rival governments and their armed backers which has pushed the country to the brink of collapse.
The UN General Assembly on Monday was dominated by discussion of the turmoil in Syria, which erupted after an uprising against President Bashar al-Assad. The United States and Russia have traded accusations about responsibility for the violence.
Russian President Vladimir Putin blamed the chaos in the region, including in Libya, on the sudden removal of the old leaders, and said this was creating many recruits for the Islamic State militant group. "It is now obvious that the power vacuum created in some countries of the Middle East and North Africa led to emergence of anarchy areas. Those immediately started to be filled with extremists and terrorists," Putin told the assembly.
DRIVING IS RECRUITMENT "Tens of thousands of militants are fighting under the banners of the so-called 'Islamic State'," Putin said, saying US actions were behind the failure of many countries, including Libya and Iraq.
Many recruits came from Libya, Putin said, "a country whose statehood was destroyed as a result of a gross violation" of a UN Security Council resolution under which the NATO action was carried out.
The United States led air strikes against Gaddafi's forces in 2011 and then handed operations over to the North Atlantic Treaty Organisation (NATO) to enforce a no-fly zone.
Russia accused the United States and its European allies of tricking fellow Security Council members and using a mandate to protect civilians as a cover for providing support to Libyan rebels and ousting Gaddafi, who was subsequently killed.
Obama told the assembly: "We will help any legitimate Libyan government as it works to bring the country together, but we also have to recognises that we must work more effectively in the future as an international community to build capacity for states that are in distress before they collapse." Libya has fragmented into two loose rival alliances of former rebels who once fought Gaddafi together but turned against each other in a battle for control.
Since last year, Tripoli has been controlled by Libya Dawn, an alliance of Islamist-leaning former militias and a powerful armed faction from the city of Misrata that set up a self-declared government and parliament in the capital.
The internationally recognised government and elected parliament has worked out of the east of the country since its armed allies were driven out of the capital, which is in the northwest. It is backed by a former Gaddafi ally, General Khalifa Haftar, and a loose formation of other armed groups.
Hard-liners from both sides have resisted peace talks, hoping they can gain more from conflict. A deal proposed by the United Nations calls for a one-year united national government, with the current elected parliament as the legislature and another chamber as a consultative body.