A man serving a six-year prison sentence was ordered released immediately Thursday and the Southwest Hennepin Drug Task Force’s work was suspended because an Eden Prairie police officer lied under oath about a search warrant earlier this year.

Dozens of cases handled by Officer Travis Serafin are under review because of his actions during the investigation of a drug and murder case against Timothy M. Holmes. Three incarcerated defendants have had their cases dismissed, including Holmes and Torrance Gray on Thursday.

At the end of a brief hearing with Holmes in an orange prison jumpsuit, Hennepin County Judge Fred Karasov ordered his swift release from custody.

“This is a travesty of justice,” Karasov said to the courtroom.

In September 2017, Serafin searched Holmes’ house, finding large amounts of heroin and fentanyl among other drugs. He found more drugs in Holmes’ car. But he had a warrant only for the house. He later falsified a warrant for the car and testified under oath in court that the two warrants were valid.

Holmes pleaded guilty earlier this year to a drug charge in exchange for the dismissal of the murder charge in the death of Margaret “Maggie” Lane of Eden Prairie in 2017, who overdosed on fentanyl-laced heroin. But two weeks ago, Hennepin County prosecutors revealed Serafin’s misconduct.

As he prepared for trial earlier this year, Assistant Hennepin County Attorney Michael Radmer asked Serafin for the warrant to search Holmes’ car. The officer produced two and blamed a clerical error. Radmer emphasized that he had been misled publicly and privately by Serafin.

“It was repeatedly represented to me and the state that this was a clerical error,” he said.

Had he known of the misrepresentation, Radmer said he would not have allowed the case to go forward.

Both defense attorney Frederick Goetz and Karasov were initially skeptical about Serafin’s explanation about the warrants. The judge sent a letter to the city of Eden Prairie, which conducted an investigation and determined that Serafin had lied; he had a legal warrant for the house only.

The city notified prosecutors who then conducted their own inquiry into Serafin’s work and found dozens of cases for which he was the lead or an important witness. Three men were in prison, including Torrance Gray, whose drug possession case was also dismissed Thursday. It’s unclear how many cases ultimately will be affected because of Serafin’s actions.

“We are carefully evaluating our options to best represent the interests of our clients, whose constitutional rights may have been violated by the flagrant deceit of this police officer,” Hennepin County Chief Public Defender Mary Moriarty said.

After court, Christopher Lane, Maggie Lane’s father, said the system had failed his daughter and Holmes. He said he wanted to “remind the police there are human lives behind each one of these case numbers. They need to be careful pursuing these cases.”

Lane said he’d never received an apology from the police and heard about the latest development through news reports.

Now, he said, Serafin should be held accountable.

Serafin, who remains employed as a police officer, had already been removed from the task force, which has now been suspended pending a “thorough outside review of policies, operations and protocol,” Hennepin County Sheriff Rich Stanek announced Thursday.

Stanek said the decision was made by a vote of the five suburban police chiefs who make up the task force, plus a member of the sheriff’s office. The shutdown could last “at least weeks,” Stanek said.

Led by the sheriff, the task force focuses on violent crime and narcotics in the participating cities of Minnetonka, Edina, St. Louis Park, Eden Prairie and Hopkins. There are four other task forces operating in Hennepin County.

Stanek said he and the five police chiefs have not yet announced who will conduct a review of the Southwest task force. “We are in negotiations with several people,” he said.

Goetz said the action was appropriate. “This is the type of thing that threatens our whole justice system,” he said. “If witnesses don’t tell the truth — especially cops — the whole system falls apart.”

As for his client, Goetz said he hopes Holmes sees the dismissal and release from prison as a “blessing” and a chance to make “fundamentally different choices” in his life.

Lane said that he has registered an internet domain with his daughter’s name, but isn’t yet sure what he will do with it. “This needs to mean something, it really does,” he said. “Otherwise, she’s just another number.”

Serafin’s actions have been sent to McLeod County prosecutors for consideration of criminal charges.