All charges have been withdrawn against a man who was accused of child sexual grooming offences following a paedophile hunter sting operation, a court has heard.
As the prosecution against Carman Azouz came to an end, his lawyer hit out at the evidence of suspected online chat which had been used against him.
Norman Shannon told Belfast Magistrates' Court the 39-year-old Algerian national spent months in custody despite nothing being found on his phone.
"He was charged on the basis of an alleged transcript," Mr Shannon said.
"I did say right at the beginning there were no proper safeguards. That is scary."
Mr Azouz, of Cameron Street in the city, faced criminal proceedings over alleged contact with paedophile hunters posing as a 14-year-old girl.
He was arrested at a location in Belfast in August last year.
At that time he was charged with attempting to meet a person under 17 for the commission of an offence.
Four further alleged offences included communicating with a person using the fictitious name "Sophie" for sexual gratification, and inciting her to make and distribute an indecent photograph of a child on dates between July 28 and August 17.
At his first court appearance police said a paedophile hunter group had posed as a schoolgirl for 20 days of online chats.
But Mr Azouz always denied the charges.
During the first hearing it was argued that paedophile hunters had been harassing him, despite efforts to block their number.
The court was told he came to Northern Ireland after his parents and sister were killed in a terrorist incident in Algeria.
Before being arrested Mr Azouz spent his time at Belfast's two mosques, carrying out cooking and gardening work, according to his lawyer.
In court on Tuesday the prosecution confirmed that all charges against the defendant were being dropped.
Mr Shannon responded: "He spent months on remand, and it turns out there's nothing on his phone.
"You should get the phones off the people who created the alleged transcript."
District Judge Fiona Bagnall said: "Hopefully it will be a learning curve for everybody."