A DeKalb County judge has ruled to exclude from trial an undercover video that prosecutors say shows a high-end escort service in action, finding that Dunwoody police obtained the video illegally.

Channel 2 Action News reported the judge suppressed the video evidence, which allegedly shows men engaging in sexual acts with the female escorts in a Dunwoody apartment. The ruling could result in the dismissal of dozens of cases, a legal expert told Channel 2.

RELATED: 56 arrested in connection with Dunwoody prostitution ring

MORE: 7 accused of running prostitution business next to Dunwoody police station

ALSO: 4 more arrests in high-end prostitution ring

One of the men caught on tape was a Gwinnett County assistant district attorney, The Atlanta Journal-Constitution previously reported. Christopher Quinn was one of 56 people arrested during a 2017 Dunwoody police crackdown on the “Gold Club” and “Lipstick and Shoes,” which authorities described as high-end escort services operating out of local apartment complexes.

Quinn resigned after his arrest.

RELATED: Gwinnett prosecutor charged in high-end prostitution ring resigns

According to the order, obtained by Channel 2, Superior Court Judge Gail Flake found that a warrant to install “multiple hidden cameras” inside an apartment in the 5100 block of Abercorn Way was defective.

The order said that the defendants had a “reasonable expectation of privacy from being secretly monitored and recorded.”

According to the news station, a Dunwoody police detective said in a hearing earlier this month that his department requested a so-called “sneak and peak” warrant to install the cameras, but since it had never been done before in Georgia, they modeled their warrant language after warrants out of Florida.

Flake ruled that “sneak and peek” warrants aren’t recognized by Georgia law. Instead, the judge found that police actually conducted a wiretap, which is governed by very stringent guidelines for approval, the news station reported.

Under state law, a district attorney is required to get a signature from a judge to secure a warrant for the secret surveillance.

“Since the State conceded that they did not comply with (the applicable Georgia law), the video evidence is inadmissible,” the judge found.

Not only is the surveillance footage excluded from evidence, Flake further ordered that prosecutors can’t mention the videos or any evidence derived from them at trial.

“The DA really has a long road to go now that this evidence has been excluded,” legal analyst Esther Panitch told Channel 2. “The process worked. The Constitution was upheld by Judge Flake, in her view.”

The DeKalb Count District Attorney’s Office offered a statement on the ruling Wednesday:

"We have received and reviewed the Judge's order related to this matter. We respect the Court's decision and are currently evaluating our options regarding the appropriate course of action. The case remains open and pending."