Muhammed Abulkasem, 19, was accused of “collecting information of a military facility” when a picture of a military helicopter was found on his phone.
They set up an online petition calling on Theresa May and foreign secretary Jeremy Hunt to intervene and secure Mr Abulkasem’s release.
On Saturday Mr Abulkasem confirmed he had been freed in an audio message posted on Youtube.
‘I am sure you would have heard about me through media outlets of my detention in an Egyptian hellhole,” he said.
“I am not ready to talk right now but I feel I owe you a duty now I am out.’
He said he was “ready to give up mentally and physically” but thanked his supporters including the Human Relief Foundation charity.
Mr Abulkasem said he would give further updates about his “ordeal in Egypt” over the coming days.
The teenager’s release was also confirmed by the Foreign Office. ”The Foreign Office provided consular assistance to a British national following his arrest in Egypt,” a spokesperson said. “He has since been released.”
Farah Ahmed, who works with the Human Relief Foundation charity and assisted the family during their ordeal, said that Mr Abulkasem was now back with them in Libya.
The Independent has contacted the Egyptian embassy for comment.
Mr Abulkasem had feared a lengthy prison sentence when he appeared in court a week after his arrest but on Saturday his mother, Imaan Rafiq, told the Middle East Eye that all charges had been dropped.
The teenager was born and brought up in Manchester but moved to Libya with his family two years ago to support his ill grandmother.
He was travelling to Egypt on a UK passport to visit friends in the country before starting university, his family said.
Join our new commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies