ALBUQUERQUE, N.M. — Actor Timothy Busfield was released from jail Tuesday night in New Mexico while he faces charges of child sexual abuse, after a judge concluded prosecutors did not prove the public would be unsafe if he were released. The ruling followed a hearing in New Mexico State District Court, where Busfield’s attorneys argued the actor best known for roles including “The West Wing,” “Field of Dreams” and “Thirtysomething” should not remain behind bars while he awaits trial.

Prosecutors had asked that Busfield stay in jail, describing alleged conduct they characterized as grooming behavior and an abuse of power spanning decades. Prosecutors declined to comment after the decision.

Judge David Murphy said the crimes Busfield is accused of inherently involve children and carry danger, but he said prosecutors did not demonstrate that releasing him would put the community at risk. Murphy said there was “no evidence of a pattern of criminal conduct” and “there are no similar allegations involving children in his past.” He added that the “defendant self-surrendered and submitted himself to this court’s jurisdiction, demonstrating compliance with the court order for his arrest.”

Outside the courthouse, Busfield’s wife, actor Melissa Gilbert, thanked Murphy for the ruling. She also thanked friends, relatives, co-workers and strangers who she said have showered her family with love. Gilbert, who played Laura Ingalls on the television series “Little House on the Prairie,” sat behind Busfield during the hearing. Busfield was handcuffed and dressed in an orange jail jumpsuit.

Busfield is facing two counts of criminal sexual contact of a minor and one count of child abuse. The allegations are tied to his work as a director on the TV series “The Cleaning Lady,” and he denies the allegations. According to the account described in a criminal complaint, Busfield was booked into jail after a warrant was issued and he turned himself in.

The criminal complaint described allegations from a boy who said Busfield touched his private areas over his clothing on one occasion when he was 7 and another time when he was 8. The complaint said the boy’s twin brother also told authorities he had been touched, but did not specify where and did not speak up earlier because he did not want to get in trouble. The complaint said one of the boys later disclosed during a therapy session that he had been inappropriately touched by Busfield, and police obtained those therapy records during the investigation.

At the hearing, Busfield’s attorneys argued that the children’s earlier statements during police interviews indicated Busfield didn’t touch them inappropriately. They also accused the boys’ parents of coaching the children toward incriminating statements after the boys lost “lucrative” roles on the show.

Busfield’s defense called Alan Caudillo, director of photography on “The Cleaning Lady,” as its only witness. Caudillo testified that children on set were never left alone with individuals and that the parents were the ones who encouraged hugs with adults on the set, according to the reporting of the hearing.

Prosecutors argued that the case against Busfield was supported by evidence they described as strong and specific. Assistant District Attorney Savannah Brandenburg-Koch said witnesses expressed fear about potential retaliation and professional harm, and she said the boys’ allegations are supported by medical findings and by their therapist. Brandenburg-Koch said the boys’ accounts were specific and “not exaggerated.”

Arguing for Busfield’s release, defense attorney Amber Fayerberg said her client would be under intense scrutiny because of publicity surrounding the charges. She said, “That bell can’t be un-rung,” adding that the idea Busfield could go out and be dangerous with a child in a world where “everybody knows who he is” was “absurd.” Busfield also submitted letters vouching for his character, and his attorneys said he passed an independent polygraph test.

Legal experts said New Mexico is among a few states that allow polygraph evidence in criminal cases, but they noted a judge has final say over whether it can be used and that there are strict requirements for admission.

Lee reported from Santa Fe, New Mexico.