The US leader said Libya was left in a
"mess" after the invasion because the PM had been "distracted by a range
of other things".
President Barack Obama has been highly critical of David Cameron over the Prime Minister's handling of foreign affairs.
The US leader said Libya had been left in a "mess" after the 2011 invasion because Mr Cameron had been "distracted by a range of other things".
In an interview with The Atlantic magazine, Mr Obama said: "When I go back and I ask myself what went wrong, there's room for criticism, because I had more faith in the Europeans, given Libya's proximity, being invested in the follow-up."
It is rare for a serving President to so publicly attack a serving British Prime Minister, although few would argue with his assessment.
Mr Obama said: "Sarkozy wanted to trumpet the flights he was taking in the air campaign, despite the fact that we had wiped out all the air defences and essentially set up the entire infrastructure."
Five years later, Islamic State is taking hold in the east of the country, no government has been formed, and Washington is considering a new intervention.
In the lengthy interview, that runs to 72 pages, President Obama also said that "free riders aggravate me," in a pointed barb at Britain's reluctance to spend 2% of GDP on the armed forces.
The PM's spokeswoman said that Mr Cameron had made clear many times that he still believes military intervention in Libya was "absolutely the right thing to do".
And she noted that he had put support for the country on the agenda when the UK hosted the G8 in Northern Ireland in 2013.