Barack Obama has admitted that the worst mistake of his presidency was the lack of planning for the aftermath of the 2011 bombing of Libya, which led to the toppling of Muammar Gaddafi.

The President said in a TV interview that while he still thought that intervening in the North African country was the right thing to do, he had regrets about preparations for the "the day after".

The comments contrast to an interview given to The Atlantic, published last month, in which Mr Obama appeared to single out his NATO allies, Britain and France, who led the Libya action, for their failure of post-conflict planning.

He called Libya a “mess” and a “shit show”, according to the Atlantic profile, adding that David Cameron had become "distracted by a range of other things".

But, asked to single out the greatest failing of his presidency, Mr Obama told Fox News on Sunday: "Probably failing to plan for the day after what I think was the right thing to do in intervening in Libya."

A UN-backed national unity government has arrived in the capital Tripoli but is waiting to take charge, with parts of the country under the control of Isis or rebel militias.

David Cameron addresses delegates during the Conservative party Spring Forum (Getty Images)