A British man who was arrested in Somalia earlier this month after suspected Islamist inmates tried to cut his throat, Somali authorities have said.

Anthony Thomas Cox, who had been working for a private security company in Mogadishu, suffered minor injuries after he was set upon by fellow prisoners said to be loyal to al Shabaab and the Islamic State.

Authorities said the attackers in Mogadishu Central Prison had tried to cut Mr Cox's throat with razor blades but were foiled when guards intervened.

"As one of the suspects was about to cut his [Mr Cox's] neck, we managed to stop him. He sustained a very minor cut. He is doing well," Abdikarim Ali Afra, the deputy governor of the prison, told the BBC's Somali service.

Mr Cox was arrested at Mogadishu airport on January 19 as he was boarding an Ethiopian airlines flight to Addis Abada when security guards found tear gas canisters in his baggage.

He is to be charged with endangering the public by failing to disclose them.

However, it is unclear when he will stand trial and colleagues in the security sector in Mogadishu have expressed alarm that he is being held in the city's central prison alongside hardened terrorists.