A Libyan terror suspect imprisoned in the UK was put in charge of guarding David Cameron on an official visit to Tripoli in 2011, it emerged last night.

The disclosure is potentially embarrassing for British security services who would have vetted Mr Cameron’s protection detail on the trip.

The intelligence agencies are already under criticism for failing to spot the danger posed by Salman Abedi, the son of a Libyan Islamist, who carried out the Manchester Arena suicide bombing.

Abedi had fought in the Libyan civil war that ousted Colonel Muammar Gaddafi and travelled to the country repeatedly where he is thought to have received terrorist training.

According to sources, the unnamed Libyan national was put in charge of the country’s close protection team following the overthrow of Gaddafi in 2011.

When Mr Cameron, who was then prime minister, visited Tripoli along with French president Nicolas Sarkozy in September 2011, the security was provided by the Libyan national, previously regarded as a terror suspect in the UK.