At a probable cause and detention hearing in U.S. District Court, the government alleged that former state Sen. Justin Eichorn was familiar with soliciting for sex on the internet and tried to have his wife clean his St. Paul apartment of a gun, laptop and cellphone before FBI agents could search it.

Those allegations were heavily contradicted by Eichorn's lawyers before Magistrate Judge Shannon Elkins ordered Eichorn released from federal jail to a halfway house in Duluth to await trial on charges of attempted coercion and enticement of a minor after his arrest in a prostitution sting orchestrated by the Bloomington Police Department last week.

Eichorn's lawyer, Charles Hawkins, said the U.S. Attorney's Office was cherry-picking statements from jail phone calls between Eichorn and his wife where they were discussing that he had her work computer at his St. Paul apartment and she wanted to pick it up.

The Eichorns, who live in Grand Rapids, manage 138 apartment units in five buildings.

FBI agents were sitting on Eichorn's St. Paul apartment last week waiting for a search warrant to be signed when Brittany Eichorn approached asking if she could get inside to get her computer. She was denied access. Over the weekend, prosecutors asked that Justin Eichorn remain jailed after FBI agents found a gun during their search. A brief filed by the U.S. Attorney's Office with the court alleged Justin Eichorn had lied to a probation officer about having the gun.

Assistant U.S. Attorney Daniel Bobier said Wednesday that Eichorn "thought his wife would get there and clean out the apartment" before the FBI arrived.

In ordering Eichorn released to the halfway house, Elkins said the government had failed to meet its burden to keep him detained.

"The evidence presented here today is much less clear than the government's brief," Elkins said. She said the discussion between Eichorn and his wife was more gray than the government alleged and could have been about their business workings, which is why she went to St. Paul to try and retrieve her laptop.

"Time will tell" if a crime was committed, Elkins said, now that the government has the laptop.

Elkins decided there was probable cause for the arrest of Eichorn but that previously ordered conditions of release — including his stay at a halfway house with GPS monitoring — were enough to ensure public safety and that Eichorn was not a flight risk.

It capped a morning of testimony that provided a robust view of the circumstances leading up to Eichorn's arrest.

Matthew Vogel, a special agent with the FBI field office in Minneapolis, was the only witness to testify. He provided a line-by-line reading of the entire text exchange over several days between Eichorn and an undercover officer with the Bloomington Police Department who was posing as a sex worker.

That officer was part of a sting with a human trafficking task force.

Vogel testified Eichorn communicated with the agent using a Voice over Internet Protocol that is common for people trying to mask their identity on the internet. He also said Eichorn was familiar with the slang and shorthand of online ads for sex workers — and that he knew how to try and discern whether an advertisement was fake or part of a police operation.

"He understands the lingo of these kind of interactions, the idioms," Vogel said on the witness stand.

Bobier said it "shows some familiarity, is that fair?"

Vogel said it was.

Officers had placed ads on websites that are known for sex trafficking and those ads were then picked up by additional websites. Members of the Bloomington Police Department then worked as "chatters" to communicate with people who engaged with the advertisement.

Eichorn allegedly first made contact with an undercover officer posing as an 18-year-old girl and asked, "What's a guy gota do to get with the hottest girl online tonight?" The next day he texted again, asking to meet for a "quick visit" or a 30 minutes of sex. The undercover officer responded with rates between $80 and $120.

The next day, Eichorn asked how old the supposed sex worker was and the undercover agent responded, "im 17 sry don't want u 2 b mad."

Eichorn continued messaging and the undercover officer once again brought up being underage. Eichorn said he believed the age of consent in Minnesota was 16 so he wasn't worried.

While the government sought to position Eichorn as soliciting a minor, Hawkins argued that Eichorn never once negotiated a price or suggested a price for the transaction and that the ad itself — with photos and body measurements — was being used to entice his client. He noted that Eichorn asked the undercover officer to verify that everything was legal.

"The indication is that he's concerned about making sure this young woman is of legal age," Hawkins said.

The government countered that the undercover officer provided price information, types of sexual acts allowed and whether or not a condom was needed and said multiple times she was 17. Once, when Eichorn said her photo looked like someone in her 20s, she responded: "I can assure you I am 17. If you aren't interested…bye."

Eichorn responded he was interested and driving to meet up now.

On March 17, Eichorn showed up as planned to meet the undercover officer. The officer told Eichorn where to park and verified Eichorn was wearing a black T-shirt and walking around a parking lot. Eichorn said yes. Then the arrest occurred.

Hawkins argued that until Eichorn saw the girl or exchanged money or consummated the sex act, it was impossible to know his intentions.

"You don't know what he intended to do when he arrived there!" he emphatically asked Vogel.

When Bobier was given a chance to question Vogel after that exchange, he asked the FBI agent if anyone was alleging that Eichorn had sex with a minor. Vogel said no, only that he was attempting to.

Eichorn was arrested and his truck was towed. A search found two cellphones, condoms and around $130 in cash.

Elkins ruled that all of that collective evidence left no doubt there was probable cause to arrest and charge Eichorn.

"An attempt to offer a minor anything in exchange for a sexual act is a violation of the law," she said.

The discussion around the role Brittany Eichorn might have played in all of this was raised by Bobier and Vogel but the U.S. Attorney's Office tried to keep her identity off the record, calling her Individual A. There were multiple jail phone calls between Eichorn and his wife that centered around her laptop, their business and the need to get to the apartment to retrieve it.

Vogel said FBI agents were stationed at the apartment because he was "concerned about potential destruction or loss of evidence." They also requested to question her, which she declined.

Hawkins did not hesitate to identify Brittany Eichorn on the record. He argued the computer was hers and the entire conversation around the contents of the computer had to do with their business dealings and the need to finalize lease agreements and locate tax documents.

Hawkins also said that Justin Eichorn had provided the U.S. Attorney with the password to the computer so they could access it.

Eichorn was elected to the Minnesota Senate in 2017, but his life and career have unraveled in the wake of the arrest.

He resigned from the Senate last week just hours before members were set to vote to expel him from the chamber. Shortly thereafter he was removed as chair of the Iron Range Resources and Rehabilitation Board. Brittany Eichorn filed for divorce Monday in Itasca County and has requested that the file be sealed, according to online court records.

Eight other men were arrested in the sting; so far Eichorn is the only suspect being charged by the U.S. Attorney's Office, rather than state authorities. A conviction on the federal count of attempted coercion and enticement of a minor carries a mandatory 10-year prison sentence.

In announcing the federal charges, a statement from Acting U.S. Attorney Lisa Kirkpatrick said her office "has no tolerance for public officials who violate federal law — particularly those laws meant to protect children."

As he left the courthouse, Hawkins was asked if he had any comment about his client being the only person charged federally in the sting.

"I'm not ready to talk about that yet," said Hawkins.

This story contains material from the Associated Press.