Josh Duggarwill be released from jail as he faces charges forreceiving and possessing child pornography.

During avirtual detention hearingon Wednesday at the U.S. District Court for the Western District of Arkansas, Judge Christy Comstock ruled that the former19 Kids and Countingstar will be allowed to leave the detention center where he has been held since hisarrestlast 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½, andMackynzie 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.

Josh and Anna Duggar.Anna Duggar/Instagram

anna duggar, josh duggar

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.

Josh Duggar.Kris Connor/Getty

josh duggar

Duggar wasarrested last weekon one count of receipt of child pornography and one count of possession of child pornography. Hepled not guiltythe following day in court.

Want to keep up with the latest crime coverage? Sign up forPEOPLE’s free True Crime newsletterfor breaking crime news, ongoing trial coverage and details of intriguing unsolved cases.

During Duggar’s arraignment last week, it was ruled that he wouldnot be allowed to live with minorsif released on bail, but he requested in the motion that hebe allowed to return hometo 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 ofJim BobandMichelle 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 sistersJill, 29, andJessa, 28, subsequentlystepped forward as two of the victims.

If convicted of the current charges against him, Duggarcould 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 torainn.org.

source: people.com