The former North Charleston officer who fatally shot Walter Scott was released from jail Monday night after a judge said he was troubled by a delay in the trial and granted bail.

Online

READ MORE: For complete coverage of the Walter Scott shooting, go to postandcourier.com/walter-scott

GALLERY: For more photos, go to postandcourier.com/galleries

The decision was met with gasps from Scott’s family and with tears from Michael Slager’s wife and parents, who appeared together for the first time in the downtown Charleston courtroom. Slager was released at 7 p.m. after posting $500,000 bail, a jail spokesman said. Under a surety bond, he would have to pay $50,000 of that total.

Under the judge’s order, he must stay on house detention in South Carolina. He can leave only for attorney and doctor visits, courtroom appearances and church services.

It’s the first time Slager has seen the outside of a jail, a transport van or a courthouse since his arrest three days after shooting Scott in the back on April 4. A cellphone video of the shooting brought scrutiny to North Charleston of police officers’ use of force against black men. Slager is white; Scott is black.

At the heart of Circuit Judge Clifton Newman’s decision was an order from the state Supreme Court that cleared the area’s top prosecutor from going to trial on other cases before Emanuel AME Church shooting suspect Dylann Roof is tried this summer. The order is why, Newman said, he had to set Slager’s trial for Oct. 31.

Meanwhile, Slager’s pretrial confinement could affect a sort of punishment on the former officer even while he is presumed innocent, the judge said. A defense attorney cited Slager’s celiac disease that has worsened with a jail diet containing gluten.

The prospect of months more behind bars prompted Newman to reconsider his decision denying bail in September, when he labeled Slager a danger to the community and a flight risk.

Scott’s loved ones were unhappy about that ruling, but they respected it, their attorney, Justin Bamberg, said.

With a community that’s on “pins and needles” with every development in the case, Bamberg urged calm to again reign after the latest milestone. After the footage of Scott’s death emerged, people protested peacefully, and the city remained quiet, unlike other cities such as Baltimore and Ferguson, Mo., where riots ravaged neighborhoods after police shootings there.

“Just be peaceful as we have been,” Bamberg said, “and know that at the end of the day, the justice system is going to run its course.”

James Johnson, a South Carolina president for the National Action Network and a longtime participant in civil rights protests, feared that Slager would flee to escape prosecution because the former officer has “nothing to lose,” he said.

“We the community are very, very disappointed in the justice system,” Johnson said.

In a separate order, the judge denied a request by Slager’s attorney for public money to pay for expert witnesses. The lawyer, Andy Savage, has represented Slager free of charge but asked for the funds to mount a proper defense.

Monday’s hearing, though, centered on the bail issue. It contained none of the extensive presentations of evidence and impassioned arguments that marked the first bail proceeding in the fall.

Savage noted the difficulty of preparing a defense and analyzing video footage of the shooting with his client in jail. Such visits between attorneys and clients happen through a videoconferencing system.

“It just cannot be done,” he said. “We tried it. It’s impossible.”

Further delays in the case as a result of Roof’s prosecution in the deaths of nine at Charleston’s Emanuel AME Church also threaten Slager’s constitutional right to a speedy trial, the lawyer argued.

Ninth Circuit Solicitor Scarlett Wilson, the lead prosecutor in both cases, handed the judge a list of other defendants who have been waiting longer for their trials.

She said nothing has changed since the judge last labeled Slager a flight risk. There is also no one who can constantly monitor Slager’s whereabouts after his release “who we can trust,” she said.

The prosecutor also said it was risky to free a defendant who feels wronged by his arrest.

“The defendant’s circumstances are very bleak,” Wilson said. “In desperate times, people take very desperate actions. That is our concern.

“It’s been clear from the start that he claims the role of the victim.”

Wilson argued that a delay in the case wasn’t a change in circumstances that the law says a judge can weigh in reconsidering a bail decision. Newman disagreed.

“The role of the court is not to seek to punish,” he said, noting that lengthy pretrial confinement can amount to punishment. “I am troubled by the delay.”

Slager’s wife and his mother hugged after the judge granted bail.

Scott’s family members consoled each other. The ruling came despite a plea by Scott’s father, Walter Scott Sr., to keep Slager behind bars until the trial. He wanted Slager to stay in jail “so he could feel the pain I feel,” he said.

“I don’t think Mr. Slager had any remorse after watching that video,” he said. “Every time I look at it, it makes me cry.”

Melissa Boughton contributed to this report. Reach Andrew Knapp at 843-937-5414 or twitter.com/offlede.