When police officers rammed down the door of the massage parlor in a squat stucco building in south Minneapolis, they saw a young woman, topless and wearing only her underwear, jump off the massage table and her naked client.

The police had their case, solid evidence that prostitution was going on at the site, which had been a concern of neighbors for some time.

The only problem is they already had their case more than 30 minutes before they burst through the door, before the undercover officer took off his clothes, before the woman disrobed and got on top of him, before he moaned and commented on her body and long before she began touching his genitals.

The public defender's office argued this week that the officer, Steven Lecy, had a good case as soon as the woman agreed to a "body to body" massage for money, widely known on the street and to undercover officers as a sex act. A judge agreed, and dismissed all charges against the woman.

The rest of the officer's behavior after the transaction was made was "gratuitous" and "outrageous government conduct" and a violation of the due process guarantees of the U.S. and state constitutions, according to Mary Moriarty, chief public defender of Hennepin County.

Moriarty should know. Female undercover officers arrest johns and get convictions all the time without letting the men touch them, and certainly long before any sexual conduct is made, she said. It's a double standard that has gone on for a long time, and allowed male officers to get way too far into a sexual situation before they make their bust. Sitting in her office late this week, Moriarty seemed a bit surprised by the media attention to this case.

"We see stuff like this a lot," she said, shaking her head.

"This was not something off a spa menu," said Moriarty. "Why is it we have male undercover police officers having sex for over 30 minutes before an arrest? Any cop knows what body-to-body massage means, and the woman was topless" during much of the massage. "The conduct of the officer was outrageous. As the judge pointed out, if there was any ambiguity why not just clarify it" while being audiotaped?

I listened to that audiotape, and it's as awkward a public document as you can imagine. Music, the kind you hear on "serenity" channels in the hospital, plays in the background. The masseuse and the undercover officer chat about mundane topics, everything from Lecy's broken hand to whether we were going to have a white Christmas. (The sting happened last December. Happy holidays, everyone!)

On the audio, there is some moaning and what sounds like an occasional skin slap. According to the transcript of the audio, the woman says he has "very, very strong legs," and Lecy asks if he should roll over, presumably onto his back. That happens at about the 34-minute mark. Another minute and 28 seconds elapse, during which time there is more moaning, a skin slap and Lecy's comment about the woman's anatomy before he says, "Wow, that's awesome … definitely gonna be a repeat customer … uhh."

I'll give Lecy some credit: He certainly seems to be staying in character.

"Repeat customer" was the code word to launch the raid. It meant Lecy — finally — had enough information to charge the masseuse with prostitution. Or maybe he just had had enough.

"There was a whole lot of conduct going on that was not appropriate for a Minneapolis police officer," said Moriarty.

As this newspaper reported, it was one of three cases that were thrown out by judges recently because an undercover officer decided he needed a little too much evidence.

Police union representatives responded to the reports of police misconduct by saying these stings are "ugly" work, and that there is no specific policy regarding prostitution stings. In fact, the public defender's office subpoenaed the police department last week for any policy, and the department responded that it didn't have one.

That is astounding, but it still doesn't explain the officers' egregious behavior. Police have been on notice that engaging in sexual actions with a defendant is improper and can ruin their cases since at least 2009, when the Minnesota Court of Appeals threw out a prostitution conviction with similar details.

So not only was the officers' behavior morally repugnant, it also was dumb police work. The fact that Susan Segal, Minneapolis city attorney, brought charges after seeing the transcript is unfathomable. Chief Janeé Harteau responded by stopping such stings, but only after her department was embarrassed in the news. Now perhaps law enforcement will refocus on arresting clients instead of prostitutes, who are often abused or just poor.

So two people engaged in behavior our society deems improper or immoral. One got arrested.

Ugly work, indeed.

jtevlin@startribune.com 612-673-1702

Follow Jon on Twitter: @jontevlin