With all the focus on air strikes in Syria, the situation in Libya has been getting less attention in the UK. But David Cameron was forced to confront it this week when he was quizzed by MPs.
The prime minister promised, in September 2011, that he would not allow Libya to turn into another Iraq, but that, said senior Conservative MP Andrew Tyrie, is effectively what has happened in the four years since the toppling of long-time leader Muammar Gaddafi.
Mr Cameron led international efforts, with France, to back rebels fighting to overthrow Gaddafi and impose a no-fly zone over the country, overcoming initial reservations from the EU and US President Barack Obama.
In a speech to cheering crowds in Benghazi's Tahrir square, after Gaddafi had been ousted, Mr Cameron said: "Your city was an example to the world as you threw off a dictator and chose freedom."
He added: "Your friends in Britain and France will stand with you as you build your democracy."
But despite efforts to support Libya's National Transitional Council, and the first elections in the country for decades, it rapidly descended into violence, with two rival governments and the formation of hundreds of militias, some allied to so-called Islamic State.
Mr Cameron was accused by MPs on the Commons liaison committee of failing to learn lessons of the 2003 invasion of Iraq, with poor post-conflict planning creating the conditions for the rise of Islamist extremism.
"The humanitarian balance sheet doesn't look good prime minister. The failure to engage in nation building has created a breeding ground for ISIL hasn't it?" asked Andrew Tyrie.
Mr Cameron said the "Libyan people were given the opportunity" to build a stable democracy - and it was a matter of "huge regret" they had not taken it.
He stressed that - unlike in Iraq - the post-conflict planning was locally-driven.
"Gaddafi was bearing down on people in Benghazi and threatening to shoot his own people like rats," he said. "An international coalition came together to protect those people and to help the Libyan people, who then got rid of Gaddafi.
"And they had an opportunity to build what they said they wanted."
He added: "We tried to do it in a way that was more remote than what had happened in Iraq. On this occasion, clearly it didn't work."
Libya now had another chance to build a stable democracy, he said, a reference to the UN sponsored peace deal signed by the two rival Libyan governments in December.
The UK is reportedly preparing to send 1,000 "non-combat" troops to help the new government stabilise Libya and stem the advance of so-called Islamic State.
But the Ministry of Defence told BBC News "no decisions have been made about the future deployment of any British military forces to Libya as part of an international coalition force".
Mr Cameron was also accused by the MPs of making the same mistakes he made over the ousting of Gaddafi with President Assad in Syria. However bad Gaddafi was for his own people, he was at least an ally of the West in the fight against Islamist extremism, said Andrew Tyrie.
"It's certainly true that Gaddafi, particularly in his latter days, was an opponent of extremist groups like al-Qaeda. He worked, famously, with the last government towards that end," said Mr Cameron.
"But I don't think, in any way, we should look back fondly to the time of Gaddafi.
"Towards the end of his time in office, he might have been on the right side of that issue but, you know, we are still dealing in Northern Ireland, with Semtex given to the IRA by Gaddafi, so I don't look back and think that that was somehow a golden era in Libyan relations.
"We have a problem now with a growing ISIL franchise in Libya, just as we have a problem with many growing ISIL franchises in many countries around the world."
Pressed by Conservative MP Julian Lewis on whether it was better to have a "brutal" secular dictator, such as Saddam Hussein, Gaddafi or Assad, in place than the "Islamist alternative", Mr Cameron insisted a "third way" was achievable for the future of Syria, with Assad gone and so-called Islamic State defeated.
15 February 2011 - Protests against Colonel Gaddafi's regime erupt in Libya
20 February - Anti-Gaddafi rebels seize control of Libya's second city Benghazi
21 February - David Cameron, on a tour of the Middle East, condemns violence by the Gaddafi regime. Over the next few days he faces criticism over the government's handling of the evacuation of Britons from Libya
28 February: Mr Cameron asks the Ministry of Defence to "work with our allies on plans for a military no-fly zone" over Libya
2 March: Mr Cameron is forced to defend the no-fly zone plan after US Defence Secretary Robert Gates dismisses the idea as "loose talk"
14 March: Mr Cameron insists it is "perfectly deliverable" - and denies he is having trouble convincing other EU leaders, with the exception of French President Nicolas Sarkozy, of the need for one
17 March: The UN Security Council votes to impose a no-fly zone over Libya
19 March: The RAF begins bombing raids alongside French and US jets, with logistical support from several Arab nations
21 March: MPs vote to authorise UK military action, which is backed by then Labour leader Ed Miliband
21 August: Rebel fighters enter Tripoli. Mr Cameron cuts short his summer holiday in Cornwall to hold a meeting of the National Security Council and makes a statement outside Downing Street saying: "Gaddafi must stop fighting - without conditions - and clearly show that he has given up any claim to control Libya."
1 September: Libya's interim rulers meet world leaders in Paris to discuss reshaping Libya, as Gaddafi urges his supporters to fight on
15 September: Speaking in Benghazi's Tahrir square, Mr Cameron praises the way Libya's interim authority has taken charge but warns the "hardest part" is still to come
20 October: Gaddafi is captured and killed by rebel fighters in the city of Sirte