A man accused of abducting and spending a night with a schoolgirl was previously arrested on suspicion of grooming her, the High Court heard on Wednesday.
Prosecutors said Dylan Colvin had received a warning notice before he allegedly headed into the woods with the 14-year-old.
Colvin, 22, of of Castle Court in Cookstown, Co Tyrone, was granted bail on condition he informs police immediately of any attempt by the girl to contact him.
Lord Chief Justice Sir Declan Morgan stressed: "If he doesn't he will go straight back into custody."
Colvin currently faces a single charge of abducting a child in February this year.
It was disclosed that the alleged offence occurred just over a week after Colvin was detained on suspicion of arranging the commission of a sexual offence and meeting a child following sexual grooming.
He had been giving the girl gifts and cards during December and January, it was claimed.
Police released him at that stage pending further investigations - but issued him with a Child Abduction Warning Notice.
The court heard both Colvin and the girl were then reported missing in the early hours of February 11.
She returned home just after midnight the following day, claiming to have been alone "up the mountain camping".
Colvin was said to have admitted spending the night with her at Cabin Wood, a small wooded area outside Cookstown.
He denied any intimate behaviour or sexual activity.
Lawyers for Colvin, who has not been charged with any grooming offences, were seeking permission for him to return to his home address in bail.
Ruling on the application, Sir Declan said: "There is every reason to believe that there is at least a risk that the child may misinterpret the relationship as an appropriate relationship and will make contact with the applicant."
But based on the time spent in custody, he held that Colin can now be released.
Imposing a curfew, the judge added: "He is under an obligation to inform police immediately in the event he's contacted by the injured party, whether directly or indirectly on any occasion."