Josh Duggar Will Be Released from Prison as He Awaits Trial in Child Pornography Case

Josh Duggar will be released from jail as he faces charges for receiving and possessing child pornography.

During a virtual detention hearing on Wednesday at the U.S. District Court for the Western District of Arkansas, Judge Christy Comstock ruled that the former 19 Kids and Counting star will be allowed to leave the detention center where he has been held since his arrest last week.

Duggar will be released Thursday to designated third party custodians, Lacount and Maria Reber, described in court as "close friends" of the Duggar family. He will be confined to their home and monitored with GPS tracking.

The judge noted that she "cannot in good conscience" release Duggar to his pregnant wife Anna and their six children — Maryella Hope, 17 months, Mason Garrett, 3½, Meredith Grace, 5½, Marcus Anthony, 7½, Michael James, 9½, and Mackynzie Renée, 11.

However, he has been granted "unlimited contact" with his children, so long as Anna is present. Duggar may not see any other minor child, including his nieces and nephews.

"Don't make me regret this decision," the judge advised Duggar, 33, before adjourning.

Attorneys for Duggar did not immediately respond to PEOPLE's request for comment. His trial is scheduled for July 6.

Anna Duggar/Instagram Josh and Anna Duggar

RELATED: Josh Duggar Hearing: Homeland Security Agent Details Timeline of Child Porn Case

Earlier in the hearing, a federal probation officer, Diem Nguyen, was called as a witness and recommended to the court that Duggar not be released. The probation officer said the Rebers sometimes have minor children over for piano lessons with their adult daughter, and that both Lacount and Maria owned firearms but not a firearm safe.

"The minors that come to the home causes the probation office some concern, as well as the pistols," Nguyen said.

In her own testimony, however, Maria said they could relocate the piano lessons and remove the firearms should Duggar reside in their home. Lacount later added that the couple and their adult daughter would ensure that Duggar has no access to their phones or computers.

Kris Connor/Getty Josh Duggar

RELATED: Jinger Duggar Recalls the Moment Brother Josh's Past Molestation Scandal Was Made Public in 2015

Duggar was arrested last week on one count of receipt of child pornography and one count of possession of child pornography. He pled not guilty the following day in court.

On Tuesday, Duggar requested that the court "release him on bail subject to a combination of conditions of release that will reasonably assure his appearance at trial and the safety of the community or any other person," according to a bond motion obtained by PEOPLE.

Want to keep up with the latest crime coverage? Sign up for PEOPLE's free True Crime newsletter for breaking crime news, ongoing trial coverage and details of intriguing unsolved cases.

During Duggar's arraignment last week, it was ruled that he would not be allowed to live with minors if released on bail, but he requested in the motion that he be allowed to return home to his pregnant wife and six children.

He argued in the motion that he is demonstrably not a flight risk, citing that he has known about his federal investigation since November and that he has no previous criminal convictions.

The motion further argued that because Duggar is a public figure, it is unreasonable to view him as a flight risk: "Duggar has a widely-recognizable face and has spent the majority of his life in the public spotlight—making any concern that he is a risk of flight all the more unwarranted."

RELATED VIDEO: Jill Duggar Dillard Posts About Importance of 'Community' amid Brother Josh Duggar's Arrest

Duggar, the oldest of Jim Bob and Michelle Duggar's 19 kids, has faced various legal battles and controversies over the years.

In May 2015, he apologized for his "wrongdoing" following the release of a 2006 police report that revealed he had been investigated as a teen for inappropriately touching five underage girls. His sisters Jill, 29, and Jessa, 28, subsequently stepped forward as two of the victims.

If convicted of the current charges against him, Duggar could face up to 40 years in prison.

If you or someone you know has been a victim of sexual abuse, text "STRENGTH" to the Crisis Text Line at 741-741 to be connected to a certified crisis counselor.

If you or someone you know has been sexually assaulted, please contact the National Sexual Assault Hotline at 1-800-656-HOPE (4673) or go to rainn.org.