A dangerous sex offender was freed from jail in Australia on Tuesday — with court-mandated permission to solicit prostitutes to stop him re-offending.

Edward William Latimer, 61, has convictions for sex crimes dating back to the 1970s and in 2006 was jailed indefinitely under the country’s “Dangerous Sexual Offenders” laws, according to the West Australian.

A psychiatrist also recently warned there was an ongoing risk of his conduct “escalating, without warning signs, to sexual assault.”

But despite the warnings, a judge allowed Latimer to leave jail on a 10-year supervision order that has 52 conditions, including a GPS tracker, curfew and restriction on women getting into his car or coming to his home in Western Australia.

It also grants him permission to solicit sex workers — as long as he first gets approval from his community corrections officer, according to the report.

“Access to sex workers will not of itself resolve the issue of the respondent’s ability to manage his sexual urges … (but) the option for the respondent to engage in regular, albeit infrequent, sexual contact should serve as an additional protective factor,” Supreme Court Judge Anthony Derrick wrote, according to The Age.

Latimer had been freed in 2014 on a similar order, though it didn’t include a provision allowing him to patronize prostitutes. He landed back in jail for breaking that order by propositioning women, according to the reports.

He argued at the time that if he’d been able to see prostitutes — which is legal in Western Australia — it would “have prevented him from approaching women,” the West Australian said.

The judge was confident it was safe to release Latimer under supervision.

“He is now able to identify some of the triggers for his offending, most specifically boredom, loneliness and talking to women that he does not know,” Derrick said, according to The Age. “He has increased his understanding of the risk situations that he will need to avoid. He has gained a rudimentary understanding of the concept of consent.”