Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

LOS ANGELES — A California appeals court ordered the dismissal of a criminal case Tuesday against a Mexican megachurch leader on charges of child rape and human trafficking on procedural grounds.

Naasón Joaquín García, the self-proclaimed apostle of La Luz del Mundo, has been in custody since June following his arrest on accusations involving three girls and one woman between 2015 and 2018 in Los Angeles County. Additional allegations of the possession of child pornography in 2019 were later added. He has denied wrongdoing.

While being held without bail in Los Angeles, García has remained the spiritual leader of La Luz del Mundo, which is Spanish for “The Light Of The World.” The Guadalajara, Mexico-based evangelical Christian church was founded by his grandfather and claims 5 million followers worldwide.

It was not clear when he would be released.

The attorney general’s office said it was reviewing the court’s ruling and did not answer additional questions.

García’s attorney, Alan Jackson, said he and his client are “thrilled” by the decision.

“In their zeal to secure a conviction at any cost, the Attorney General has sought to strip Mr. Garcia of his freedom without due process by locking him up without bail on the basis of unsubstantiated accusations by unnamed accusers and by denying him his day in court,” Jackson said in a statement.

La Luz del Mundo officials in a statement urged their followers to remain respectful and pray for authorities.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

“(W)e are not to point fingers or accuse anyone, we must practice the Christian values that identify us, such as patience, prudence, respect and love of God,” they said.

The appeals court ruling states that the Los Angeles County Superior Court must dismiss the 29 counts of felony charges that range from human trafficking and production of child pornography to forcible rape of a minor.

The appeals court ruled that because García’s preliminary hearing was not held in a timely manner and he did not waive his right to one, the complaint filed against him must be dismissed.

In June, García was arraigned on 26 counts and waived his right to a speedy preliminary hearing — a common move. The following month, he was arraigned on an amended complaint that included three additional charges of possession of child pornography. That time, he did not waive the time limits for a preliminary hearing.

His hearing was postponed several times — in some instances, because prosecutors had not turned over evidence to the defense — as he remained held without bail, prompting his attorneys to file an appeal.

The appeals court ruled that a preliminary hearing on an amended complaint for an in-custody defendant must be held within 10 days of the second arraignment — unless the defendant waives the 10-day time period or there is “good cause” for the delay.

The appeal only mentioned the dismissal of García’s case and not those of his co-defendants, Susana Medina Oaxaca and Alondra Ocampo. A fourth defendant, Azalea Rangel Melendez, remains at large.

It was not immediately clear if the co-defendants’ cases would also be tossed.

In February, a Southern California woman filed a federal lawsuit against the church and García. In it, she said García, 50, and his father sexually abused her for 18 years starting when she was 12, manipulating Bible passages to convince her the mistreatment actually was a gift from God.

The lawsuit will continue despite the dismissal, the woman’s lawyers said Tuesday in a statement.

The dismissal is the latest in a series of blunders on this high-profile case for the attorney general’s office.

Attorney General Xavier Becerra himself pleaded with additional victims to come forward — a move defense attorneys said could taint a jury pool.

“It would be hard to believe that, based on the information that we’re collecting, that it’s only these four individuals,” Becerra said in June, repeatedly calling García “sick” and “demented.”

Prosecutors Amanda Plisner and Diana Callaghan also said multiple times in court that they expected to file additional charges based on more victims as the case continued to be investigated. But ultimately they only added three counts of possession of child pornography to the original complaint.

Plisner and Callaghan were additionally sanctioned by a Superior Court judge in September, who said they had violated a court order in failing to give defense lawyers evidence. The judge later rescinded the sanctions and overturned $10,000 in fines she had levied.