Darren Rothwell left HMP Forest Bank, a men’s prison in Salford, U.K., on the morning of April 18. The 42-year-old then boarded a train, where he attacked the girl after asking her for a hug, the British Transport Police said.

A judge sentenced him to 26 months in prison in Bolton Crown Court on Friday after he pleaded guilty to sexual assault.

On the day of the attack, Rothwell made his way to Manchester Victoria train station at around 9 a.m. and boarded a train home to Wigan.

He approached two women on the train who were traveling with their young children.

Police said the women felt intimidated by Rothwell, who was drinking brandy from a bottle, aggressively cursing and bragging about his release from prison.

He also told them that he was on his way to visit a former partner who had a restraining order against him and that he would be back in prison within days, according to police.

Later, Rothwell asked one of the women’s daughters, a five-year-old girl, to take her shirt off and give it to him. One of the women challenged him about his behavior, but police said he proceeded to try and kiss them both.

Police said he also encouraged the women to Google an alias of his—“Darren Noonan”—and told them they would find news reports about his convictions for rape, sexual activity with a child and child abduction from 10 years ago. He was jailed for nine years for the rape of a teenage girl with learning difficulties, the The Manchester Evening News reported.

When the train approached Wigan, Rothwell asked the five-year-old girl for a hug and went to pick her up before sexually assaulting her in front of her mother. Police said the girl’s mother intervened and her friend pulled her daughter away. She then used a police text messaging service to report the incident.

Rothwell, of Wigan, failed to attend his probation appointment later than afternoon. He was arrested on suspicion of sexual assault and breaching his restraining order on October 20. Two days later, he appeared in court and was taken back to HMP Forest Bank.

Detective Constable Ian Grice described Rothwell as “beyond reprehensible” and “exceptionally dangerous.”

“Rothwell clearly had absolutely no desire to rehabilitate himself after prison, but to sexually assault a 5-year-old child before he’d even made it home is beyond reprehensible,” he said.

“He is clearly an exceptionally dangerous individual and I am relieved, as I’m sure his victim’s family will be, to see him back behind bars. I can’t imagine how traumatic this must have been for them and I hope they are now able to begin to put this terrible incident behind them.”