A federal judge has ordered the conditional release of a convicted pedophile who led the New Orleans Police Department’s child abuse unit in the 1980s before his career ended in scandal and a lengthy prison term.

The former detective, Stanley C. Burkhardt, 64, who infamously pursued predators as a cop even as he trafficked in child pornography at home, remained behind bars for years after completing his sentence under a controversial federal program in which men deemed “sexually dangerous” may be committed indefinitely to a North Carolina prison.

Burkhardt underwent more than three years of treatment there and, according to the court order allowing his release, has “recovered to the extent that he will not experience serious difficulty in refraining from sexually violent conduct or child molestation.”

He was released this spring under a list of strict conditions, including that he be monitored electronically for a year and that he serve six months at a New Orleans halfway house.

Burkhardt, who did not return calls seeking comment Monday, has been housed at the Volunteers of America re-entry center on St. Anthony Street.

The release marks a chance at redemption for a once-decorated officer who wore the badge for 15 years and, according to news accounts, was credited with starting the department’s first “pedophile unit.”

Burkhardt’s last stay at a halfway house, a 2006 stint in Baton Rouge, resulted in his return to prison after he was caught using a computer at a public library to look up images of teenage boys and to send emails about molesting children.

The legal saga began in 1987. Still on the force at the time and recovering from a gunshot wound he suffered in the line of duty, Burkhardt was arrested that year in a sting operation after he unwittingly mailed explicit images of young boys to undercover agents around the country. He completed a therapy program and was released from prison on those charges in 1992. He pleaded guilty to a separate state charge of molesting a 9-year-old family member years earlier but was sentenced to time served.

In the years after his release, Burkhardt found work as a truck driver, stagehand and data compiler. But his obsession with child pornography apparently remained unabated, even after he promised a federal judge he was a changed man.

In 1998, federal authorities conducted another sting operation during which Burkhardt accepted a pornographic video from a postal inspector posing as a mail carrier. Officers searching his home found a 12-year-old boy inside, in addition to child pornography in the form of videos and magazines. No charges were filed in connection with the juvenile, but Burkhardt was sentenced to nine years in federal prison after pleading guilty to receipt and possession of material involving sexual exploitation.

He was released to a halfway house in 2006 even after prison officials searched Burkhardt’s cell and found nearly 100 pictures of teenage boys cut from magazines and articles about the North American Man/Boy Love Association, a pedophile advocacy group, according to a 2006 report in The Advocate.

However, the incident at the public library in Baton Rouge prompted a federal judge to revoke Burkhardt’s supervised release and send him back to prison for another year.

Days before his expected release in 2007, he learned he would remain in prison in Butner, North Carolina, under the Adam Walsh Child Protection and Safety Act, a 2006 law that allows authorities to seek indefinite civil commitments of “sexually dangerous persons” based on assessments from mental health professionals. Critics of the law say it is intended to prevent future crimes rather than to punish adjudicated misdeeds.

Burkhardt’s proceedings were stayed as the U.S. Supreme Court considered — and eventually shot down — a challenge to the law. In late December 2011, a judge ordered he be held in federal custody “until his condition was such that he would not be sexually dangerous to others.”

A forensic psychologist had diagnosed Burkhardt with “hebephilia,” a strong sexual attraction to pubescent boys and girls.

At first, it appeared Burkhardt might never be released from custody. He initially took a “superficial and perfunctory” approach to his treatment program at Butner, according to a 13-page report prepared in February by prison officials who ultimately recommended his conditional release.

“Rather than surrender to the process of change and wholeheartedly commit to personal transformation, Mr. Burkhardt continued to willfully maneuver the process,” the report said.

But he made substantial progress over the course of 157 weeks of treatment, the report said, a period in which he accounted for “documented and undocumented criminal sexual history” and demonstrated a “solid and well integrated understanding of the impact his criminal and abusive actions have had on his victims.”

The former cop created a weekly Bible study group with his peers and managed to overcome the “Machiavellian attitudes” he blamed for his long history of sexual offending, the report said. His sexual arousal involving boys remained “minimal and infrequent” during treatment, though the report acknowledges this “may have been partly due to the absence of minors in this environment.”

“While not an immediate need or his primary focus upon release,” the report said, “Mr. Burkhardt has consistently voiced an interest in pursuing an intimate relationship with an adult partner when and if the time is right.”

The conditions of Burkhardt’s release include regular submission to polygraph examinations and searches, as well as strict limitations on his contact with minors.

He may be returned to custody if he fails to adhere to any of the requirements, according to an order signed March 30 by U.S. District Judge James Dever, of Raleigh, North Carolina.

Follow Jim Mustian on Twitter, @JimMustian.