The suicide bomber who killed 22 people at Manchester Arena was rescued from Libya by the British military less than three years before committing the attack, it has emerged.

Salman Abedi was 19 when he boarded the HMS Enterprise in Tripoli with his brother and more than 200 other British citizens in August 2014.

The Foreign Office had told any remaining UK nationals to leave the country immediately because of worsening violence, including battles that forced the closure of Libya’s main airport in Tripoli.

​Abedi, who was not believed to be a security threat at the time, registered for evacuation under his real name and passport and was taken to Malta.

“The Border Force was sent over to assist the evacuation of British citizens and their dependants known to be in the area, or who had contacted the government for help,” a government source told The Independent.

The source said helping Abedi may have been regrettable “in hindsight, but a British national needed help abroad and we were assisting them to leave Libya”.

The HMS Enterprise was later deployed as part of a Europe-wide mission to rescue refugees fleeing over the Mediterranean Sea on smugglers’ boats – a crisis that has so far seen more than 17,000 men, women and children drown.

Abedi was on holiday during a gap year from Manchester College at the time of the rescue, the Daily Mail reported, and had been regularly visiting Libya after his parents returned to their home country during the 2011 revolution that ousted Muammar Gaddafi.

CCTV image of Manchester bomber Salman Abedi (PA/GMP)

A review of intelligence leading up to terror attacks that struck Manchester and London last year found that Abedi was first flagged as a security risk in January 2014 – seven months before he was picked up in Libya.

The teenager was initially thought to be “an individual seen acting suspiciously” with a person being monitored by MI5, David Anderson QC said.

Although he did know the person in question, that particular incident turned out to be a case of mistaken identity and his record was shut in July 2014.

​Abedi was classed as a closed “subject of interest” of low risk at the time, but the investigation reopened in October 2015 over potential contact with Isis fighters in Libya.

The security services found the contact was “not direct” and stopped investigating Abedi for a second time, and later missed an opportunity that may have prevented the Manchester attack by misreading two pieces of “highly relevant” intelligence.

Intelligence officials were due to review the risk the terrorist posed on 31 May, little a week after he blew himself up among young fans leaving an Ariana Grande concert.

A police investigation into the atrocity is ongoing, and British authorities are attempting to transfer his brother Hashem Abedi from a militia’s custody in Libya to the UK for possible prosecution.

The country continues to be engulfed in chaos as continued fighting between rival militias leaves the UN-backed Government of National Accord unable to stop rampant human smuggling, slavery, sexual violence and human rights abuses.

Manchester Bombing Attack: one year on Show all 10 1 /10 Manchester Bombing Attack: one year on Manchester Bombing Attack: one year on The Flower Festival at St Ann's Church marking the Manchester Arena bombing Manchester Bombing Attack: one year on The Trees of Hope trail in St Ann's Square where people are encouraged to leave and share tributes Manchester Bombing Attack: one year on The Flower Festival at St Ann's Church marking the Manchester Arena bombing Manchester Bombing Attack: one year on The Trees of Hope trail in St Ann's Square where people are encouraged to leave and share tributes Manchester Bombing Attack: one year on The Trees of Hope trailin St Ann's Square where people are encouraged to leave and share tributes Manchester Bombing Attack: one year on The Trees of Hope trailin St Ann's Square where people are encouraged to leave and share tributes Manchester Bombing Attack: one year on The Trees of Hope trailin St Ann's Square where people are encouraged to leave and share tributes Manchester Bombing Attack: one year on Embracing Manchester Exhibition at St Ann's Church was created by artist Ghislaine Howard after being inspired by Muslim video blogger Baktash Noori who, after the attack spent days in the city centre trying to win the trust of the public. Manchester Bombing Attack: one year on The Flower Festival at St Ann's Church marking the Manchester Arena bombing Manchester Bombing Attack: one year on The Trees of Hope trailin St Ann's Square where people are encouraged to leave and share tributes

A report by MPs found David Cameron “ultimately responsible” for Libya’s bloody collapse because of his flawed intervention to help overthrow Gaddafi, when the UK was among countries conducting a bombing campaign.

The Foreign Affairs Select Committee said a lack of strategy for the ensuing power vacuum or reconstruction efforts caused “political and economic collapse”.

It allowed endless bloodshed in Libya, as well as the rise of Islamist extremist groups and the spread of regime weapons used to spark the Malian civil war and in conflicts elsewhere.

Isis gained a foothold in the country and seized territory around the coastal city of Sirte, setting up terror training camps bombed by the US last year over intelligence that “external plotters were actively planning operations against Europe”.

The war also triggered the refugee crisis in the Central Mediterranean, as Libyans and migrant workers who had settled in the country fled, followed by sub-Saharan Africans trafficked through the country by brutal gangs.

More than 700,000 migrants are currently believed to be in Libya, where the local coastguard and Italian authorities are currently forcing migrants to return to after being intercepted at sea.

Tom Dowdall, deputy director of the National Crime Agency, told The Independent the situation was causing a “bottleneck” as more people enter Libya from the south.

“This will all depend upon the ability of organised crime groups to access vessels,” he added.