US President Barack Obama has said the biggest mistake of his presidency was the lack of planning for the aftermath of the fall of late Libyan leader Muammar Gaddafi, with the country spiralling into chaos and grappling with violent extremists.

Reflecting on his legacy in a Fox News interview aired yesterday, Mr Obama said his "worst mistake" was "probably failing to plan for the day after what I think was the right thing to do in intervening in Libya."

Last month, Mr Obama made a searing critique of British Prime Minister David Cameron and former French leader Nicolas Sarkozy for their roles in the bombing campaign they led in Libya.

In an interview with The Atlantic magazine, the US President said Mr Cameron became "distracted" and Mr Sarkozy wanted to promote his country during the 2011 NATO-led military intervention.

Since the downfall of Gaddafi, who was killed in a popular uprising, Libya descended into near-anarchy, ruled by rival militias vying for power while the Islamic State group has gained influence in the country.

The head of a UN-backed unity government arrived earlier this month in the Libyan capital, Tripoli, to begin garnering support for his government.

Mr Obama also reflected on some of the best moments of his tenure as president in the Fox News interview. His presidency is due to end next January.

"Saving the economy from a great depression" was his biggest accomplishment, he said.

Asked what was the best day in the White House, Mr Obama said: "The day that we passed health care reform.

"We sat out on the Truman Balcony with all the staff that had worked so hard on it and I knew what it would mean for the families that I'd met who didn't have health care."

Mr Obama said his worst day in the White House was when he travelled to Newtown, Connecticut, after a gunman shot 20 young children and six adult staff members at an elementary school in December 2012.