The UK “could have done more” to stop the chaos and bloodshed in Libya that followed Western intervention, a Foreign Office minister has admitted.

Tobias Ellwood defended RAF air strikes against dictator Muammar Gaddafi, ordered by David Cameron, saying there was a “duty to protect” civilians during the North African country’s 2011 revolution.

The UK’s role in Libya – where Manchester bomber Salman Abedi had strong links – has come under renewed scrutiny since the attack, which killed 22 people.

Manchester attack: City pays tribute one week on

Since the revolution, the country has descended into a state of semi-anarchy with power divided between rival governments and arms factions including Isis.

The unstable situation has also allowed Libya to become a central hub of the refugee crisis as people smugglers take advantage of widespread lawlessness to launch thousands of boats towards Europe.

Jeremy Corbyn said soon after the Manchester bombing that British foreign policy has worsened terror threats to the UK.

But Mr Ellwood, speaking about the Libyan campaign at a Royal United Services Institute (RUSI) event, said: "I really do believe that not knowing the full outcome of events is not reason for inaction."

He referred to the duty to protect civilian areas before adding: "But we didn't do it to try and transform Libya and do something else.

"We did it to support the people of Libya against a criminal and indeed a terrorist himself with what he did with the Pan Am flight and so forth.

In pictures: Isis' Libyan stronghold of Sirte Show all 10 1 /10 In pictures: Isis' Libyan stronghold of Sirte In pictures: Isis' Libyan stronghold of Sirte Isis in Sirte Isis fighters parade through in Sirte in 2015 In pictures: Isis' Libyan stronghold of Sirte Isis in Sirte Islamic State (IS) group jihadists on the outskirts of Libya's western city of Sirte AFP/Getty In pictures: Isis' Libyan stronghold of Sirte Isis in Sirte A photo of a billboard in Sirte, Libya, listing seven rules for women's clothing, saying they must be loose-fitting and undecorated HRW/social media In pictures: Isis' Libyan stronghold of Sirte Isis in Sirte Isis militants process down a street in the coastal city of Sirte in Libya this week; the group has heralded Libya as its ‘strategic gateway’ to attack Europe AFP/Getty Images In pictures: Isis' Libyan stronghold of Sirte Isis in Sirte An Isis lecture on Sharia at the Ouagadougou complex in Sirte, Libya, in 2016. HRW/social media In pictures: Isis' Libyan stronghold of Sirte Isis in Sirte A sign reading "The city of Sirte, under the shadow of Sharia" as smoke rises in the background while forces aligned with Libya's new unity government advance on the eastern and southern outskirts of the Islamic State stronghold of Sirte on 9 June. Reuters In pictures: Isis' Libyan stronghold of Sirte Isis in Sirte Fighters loyal to Libya's GNA prepare to launch attacks against Isis as they continue their resistance on the outskirts of the western city of Sirte Getty In pictures: Isis' Libyan stronghold of Sirte Isis in Sirte Forces loyal to Libya's UN-backed unity government are seen during clashes with jihadists of the Islamic State (IS) on the western outskirts of Sirte on June 2, 2016. AFP/Getty Images In pictures: Isis' Libyan stronghold of Sirte Isis in Sirte Forces loyal to Libya's UN-backed unity government fire during clashes with Isis around 14 miles west of Sirte on June 2, 2016. AFP/Getty Images In pictures: Isis' Libyan stronghold of Sirte Isis in Libya

"There were elections, there was a Prime Minister, there was a transition council as well and then also, of course, a general national congress.

"It was 40 years of misrule in a very complex society with huge tribal constructs across there, after 40 years all these tribes found they had a bit of space, a bit of elbow room, and yes perhaps we could have done more but we were asked to leave, the international community was asked to take a step back from its involvement.

"But, yes, there have been consequences of that which we now need to work with the Libyans to make sure that Derna and Sirte and places like this, where Daesh has now moved itself because we've been succeeding in Iraq, is not able to train those people that causes the harm in places like Manchester."

Also speaking on the panel was the shadow Foreign Secretary, Emily Thornberry, who echoed Mr Corbyn’s comments.

She said the "failure of Libya" resulted in large ungoverned parts of the country which "directly leads to us being less safe" if these areas are used to train and arm people who "turn themselves on the West".

Barack Obama has been among the most prominent critics of the UK's role, last year accusing Mr Cameron of allowing the country to become a "shit show" after Gaddafi was killed.