Two judges dismissed charges on Wednesday against the defendants in the New Mexico compound case that has drawn headlines for weeks for its lurid and racially-charged details, in a major blow to the prosecution.

Judge Emilio Chavez said he had no choice but to release the three defendants, Lucas Morton, Hujrah Wahhaj and Subhannah A. Wahhaj, because the office of District Attorney Donald Gallegos failed to schedule a court hearing to prove they had probable cause for their arrest within 10 days, as state rules stipulate, according to court representatives and defence lawyers.

Another judge later ruled that charges also be dropped against the other two remaining defendants, Siraj Wahhaj and Jany Leveille, according to Ryan Laughlin, a reporter for the local television station KOB, but the status of their potential release is less clear as they were immediately charged again with more severe charges of child abuse resulting in death.

"For whatever reason the state did not obtain a preliminary hearing date within 10 days," Aleksander Kostich, a public defender representing Mr Morton, told The Washington Post. "It's absolutely bizarre."

"I wish they had an explanation," Megan Mitsunaga, who represents Subhannah Wahhaj, told The Post. "They provided none to us or the court. I would have thought they'd be more on top of things, the way they continued to seek to hold them without bond."

The developments were the latest twist in the tense case, which has drawn wide attention since the ramshackle rural plot in Amalia, which consisted of a trailer dug into the ground and surrounded by old tires and an underground tunnel, was raided on 3 August.

The combination of its lurid details – law enforcement officials said they found 11 children, as well as the body of Siraj Wahhaj's 3-year-old son Abdul-Ghani ​– and the accusations made in court by prosecutors but cautioned against by a judge, that the defendants were Muslim extremists engaged in a terrorist training camp of sorts, brought the case to wide national prominence.

Mr Gallegos' office did not a return a request for comment.

Siraj Wahhaj and Jany Leveille both pleaded not guilty to new charges, according to the Associated Press. The outlet reported that prosecutors said they found a hand-written document called "Phases of a Terrorist Attack," from the property. In other filings, prosecutors alleged that children had told them that some of the adults at the compound had talked about dying in jihad.

New Mexico compound search Show all 6 1 /6 New Mexico compound search New Mexico compound search Aerial photo released by Taos County Sheriff's Office shows a rural compound during an unsuccessful search for a missing 3-year-old boy in Amalia, New Mexico AP New Mexico compound search Taos County Solid Waste Department Director Edward Martinez, center, surveys property conditions at a disheveled living compound at Amalia, N.M., on Tuesday, Aug. 7, 2018 AP New Mexico compound search Siraj Ibn Wahhaj, left, sits next to public defense attorney Aleks Kostich at a first appearance in New Mexico state district court in Taos, New Mexico, Wednesday, Aug. 8, 2018, on accusations of child abuse and abducting his son from the boy's mother AP New Mexico compound search Lucas Morton arrives in court to plead not guilty to child abuse charges in state district court in Taos, New Mexico, on Wednesday, Aug. 8, 2018 AP New Mexico compound search Subhannah Wahhaj appears in New Mexico state district court to plead not guilty to charges of child abuse in Taos, New Mexico, Wednesday, Aug. 8, 2018, alongside public defense attorney Greg Dawkins, left AP New Mexico compound search This Friday, Aug. 3, 2018, photo released by Taos County Sheriff's Office shows a rural compound during an unsuccessful search for a missing 3-year-old boy in Amalia, New Mexico AP

But there have been some signs that the case was not going as officials had hoped, for weeks. The defendants were all charged with 11 counts of felony child abuse, but not anything terrorism-related, and the guns they were found with were legal, a judge said. And that judge, Sarah Backus, also ordered them to be given a limited release against the wishes of prosecutors after she found the evidence that they were a danger to the community to be thin.

Mr Kostich and Ms Mitsunaga said prosecutors from Mr Gallegos' office did not offer a clear reason why they did not schedule the preliminary hearing, as required, within the 10-business-day window, which began after the defendants' first court appearance on 8 August. That window expired on 22 August, Judge Chavez noted in his ruling.

Prosecutors will have the option of trying the former defendants by securing a grand jury indictment against them, Mr Kostich said.

"The judge's hands were tied because the rules are very clear," Mr Kostich said. "This is not the end of things, they will most likely try to recharge him through the use of a grand jury proceeding."

It is possible that the case was complicated by ambiguities around the defendants' custody. While Ms Backus ordered all five suspects to be released to house arrest and with other strict terms like GPS monitoring, they all remained in custody as they were not able to meet these requirements.

Siraj Wahhaj was at one point subject to an extradition to Georgia, where a warrant had been issued for his arrest on the suspicion that he abducted his son, Abdul-Ghani. Ms Leveille, who is from Haiti, had been held by federal immigration officials. According to Mr Laughlin, both were immediately charged a second time by the sheriff's office after the judge dismissed their charges, but the judge questioned the legitimacy of the new charges and set another hearing for Tuesday.

He also excoriated the district attorney's office.

"Judge McElroy is hammering the DA office," Mr Laughlin reported. "He says he doesn't know if the office is overworked or what, but he finds it disturbing the state didn't play by the rules. Notes the DA is not present here."

The case has become a target of conspiracy theories and anger in far-right circles, due in part to its unproven connections to terrorism. Judge Backus, who said she was bound by judicial ethics to order the defendants be given a limited release, was the target of a sustained harassment campaign that prompted security officials to lock down the courthouse for an afternoon after she received death threats.

Court officials said they had never seen such a voluminous and vitriolic response to a court ruling. On Wednesday, some far-right conspiracy theorists began spreading baseless theories about why the prosecution had let the case lapse.