A High Court judge has raised concerns after police returned a passport to a 17-year-old girl thought to be in danger of travelling to an area controlled by Islamic State.
Mr Justice Hayden heard that officers specialising in counter terrorism work seized the teenager's passport in April after she was stopped at Bristol airport when staff spotted that she had a one-way ticket to Turkey.
But he was told police thought anti-terror legislation did not allow them to keep the passport for longer than two weeks and returned it a few days ago after a relative said the girl needed to go to a wedding in Scandinavia.
The judge said police could have addressed the problem immediately by taking civil court action.
He has made the youngster a ward of court - a move that prevents her from travelling abroad without a judge's permission - and ruled the passport must again be taken from her.
Detail of the case was outlined to Mr Justice Hayden at a hearing in the Family Division of the High Court in London late on Thursday after social services staff involved with the girl's family became concerned and took legal action.
But the judge ruled that nothing could be reported until today so that police had time to find the girl.
Mr Justice Hayden heard submissions from a lawyer representing Bristol City Council via a video-link to Bristol. He also heard evidence from a policeman via the same link.
He said the girl and her family could raise any concerns about his decision at another High Court hearing scheduled for next week.
The judge stressed that counter terrorism officers working with radicalised Muslim teenagers faced an "immense challenge". But he said he wanted to ensure that units across the UK understood the options available and worked in harmony.
He heard that the teenager was of Somali origin and lived in the Bristol area. But he said she could not be identified.
He was told officers involved were members of the South West Counter Terrorism Intelligence Unit and social services staff worked for Bristol City Council.
"The police, quite wrongly in my view, took the view that they were constrained to return the passport," said Mr Justice Hayden. "They were not."
He added: "An immediate telephone application (to the High Court) could have been made."
The girl is one of a number of teenagers thought to be at risk of travelling to areas controlled by Islamic State who have been grounded by judges sitting in the Family Division of the High Court in recent months after social workers and police raised concerns.
Teenagers who have been made wards of court include four girls from London who attend the same school - Bethnal Green Academy in Bethnal Green, east London - as three girls already thought to have fled.