Police and social services bosses have apologised to a man who found himself at the centre of a High Court case after wrongly being suspected of sexually exploiting a teenage girl.
A High Court judge who had made an order barring the man from approaching the girl, now 15, has outlined the apology in a ruling on the case.
Mr Justice Keehan, who had analysed evidence at a hearing in the Family Division of the High Court in London, said an error "borne of lax and less than rigorous procedures" had been made.
He said police and social services staff had tightened procedures as a result.
The judge has not identified the man or the girl in his written ruling. But he said the local authority involved was Birmingham City Council.
The judge said he had discharged an injunction he had made against the man once the error came to light.
He said council and police bosses had written a "suitable and regretful letter of apology" to the man.
Mr Justice Keehan said "this most serious and unfortunate set of circumstances" had led to police and social services staff creating a "protocol" covering all stages of the investigation of cases of child sexual exploitation.
The man had been "identified as a possible perpetrator of a child sexual exploitation of (the girl)" at a multi-agency meeting involving council staff and West Midlands Police officers in January 2015, said Mr Justice Keehan.
Birmingham Council had subsequently asked for an order barring the man from approaching the girl.
Mr Justice Keehan said he granted an injunction at a hearing in March 2015 "on the basis of the information then before me".
"Within days of making that order, however, it became evident that there had been a serious lack of communication and/or a misunderstanding between the police and the legal department of the local authority," said the judge.
"It also became clear that (the man) had quite wrongly been identified as a possible perpetrator of a child sexual exploitation of (the girl) at the multi-agency meeting held on 20 January 2015.
"Quite properly the local authority immediately applied to me to discharge the injunction against (the man). I granted the same but required a detailed explanation from the local authority and from the police as to how such a serious mistake had been made.
"I was promptly provided with an explanation."
The judge added: "I accept it was a genuine and unintended error borne of lax and less than rigorous procedures. The local authority and the police, with the court's approval, wrote an entirely suitable and regretful letter of apology to (the man)."
And he went on: "The positive outcome of this most serious and unfortunate set of circumstances has been the creation of a protocol devised by the local authority and the police. It is an extremely helpful document."
Concerns had been raised about the girl when she was 13, Mr Justice Keehan said.
Social workers intervened after discovering she was "keeping the company of much older men" and was "beyond the control of her parents".
The judge said the council had launched care proceedings.
In late 2014, Mr Justice Keehan made a series of stay-away orders against 10 men after concluding that they had sexually exploited a 17-year-old girl in Birmingham City Council's care.
He imposed injunctions barring the men from contacting the teenager and from approaching girls they did not know, following applications from Birmingham council bosses, and ruled that the men could be identified in media reports.
And he said the men could be jailed for being in contempt of court if found to have breached his orders.
Mr Justice Keehan said he hoped that anyone who sexually exploited children had been given a ''powerful message'' and that more local authorities would use civil courts to target people who sexually exploited vulnerable girls.
The judge said police had come to the conclusion that there was insufficient evidence to secure criminal convictions against the 10 men.
And he said Birmingham Council's decision to ask for civil court injunctions had been a "bold and novel" step.