A St. Paul man was sentenced Thursday to a little over three years in prison for exposing his genitals in public, a crime he has committed several other times.

Attorney Emma Koski, who represents Shawn M. Tillman, 30, unsuccessfully asked for probation and some time in the workhouse. She argued that incarceration would deprive her client of the mental health treatment he needed to curb his behavior, which she said was his only coping mechanism for anxiety and claustrophobia.

Ramsey County District Judge Richard Kyle Jr. sentenced Tillman to prison time, but didn’t grant Assistant Ramsey County Attorney Cory Tennison’s request for closer to four years in prison.

“We have to balance many considerations,” Kyle said.

The judge agreed with both attorneys, noting that Tillman had mental health issues that needed treatment, and that public safety was also a concern because Tillman allegedly exposed himself twice while he was released from custody.

Tillman pleaded guilty in Oct. 2017 to one count of indecent exposure in the presence of a minor. While out of custody awaiting sentencing, he allegedly exposed himself and masturbated twice in public in front of people — in April 2018 at a light rail platform in Minneapolis and in May 2018 in someone’s driveway, also in Minneapolis.

Tillman is charged in Hennepin County for the two cases, which are pending.

He pleaded guilty in Ramsey County to exposing himself and masturbating on July 25, 2017 inside the common space of an apartment building in St. Paul. Tillman had gained entrance to the building when someone entering it let him in. A woman with an infant witnessed his behavior.

Tennison said that although Tillman has mental health issues, his pattern of behavior was a public safety concern.

“She was very scared by what happened,” Tennison said of the woman. “We just can’t be thinking today about Mr. Tillman’s needs. We have to be thinking about the public and public safety.”

Koski argued that Tillman, who struggles with homelessness, did not target children or people with his acts, and said the behavior was a compulsive coping mechanism. Tillman derives no sexual gratification from it, she said.

“He wants help to stop the behavior,” she said, adding that he had a proven record of success when he was enrolled in treatment programs versus incarceration in the state’s prison system.

When given a chance to speak, Tillman said prison would be detrimental to his rehabilitation because he would be “locked in a cell” instead of getting treatment.

“I don’t feel like I’m getting … the proper chance,” Tillman said.

Twitter: @ChaoStrib