A man who admitted in April to using a fake gun to rob the Laramie Kmart pharmacy of a large quantity of painkillers in 2013 was sentenced to prison Thursday in Albany County District Court.

Judge Jeffrey Donnell sentenced 27-year-old Michael Luke Yerkovich of Rock Springs to a three- to eight-year prison term with credit for the 30 days he has already served. Donnell included a recommendation that Yerkovich be placed in the intensive treatment unit and continue to receive his prescribed medication while in custody.

Yerkovich admitted in April to pacing throughout the Laramie Kmart for roughly 45 minutes on Feb. 15, 2013 before taking a toy gun from a shelf, representing it as a deadly weapon and demanding "all of the oxycodone and roxycodone" from the pharmacist. Court documents say Yerkovich fled on foot with 11 bottles full of 767 prescription pills worth $761.85.

He managed to stay off the radar until Oct. 22, 2015, when Laramie police received a tip naming Yerkovich as the suspect in that robbery as well as a similar robbery of Smith's Grocery Store in Casper committed March 25, 2013. That tip led to Yerkovich's arrest in Casper on Nov. 13.

Defense attorney Jason Tangeman requested Yerkovich be sentenced to a term of supervised probation, arguing that Yerkovich was driven to commit the robbery at least in part by mental health issues which are now being successfully treated.

Quoting from medical records, Tangeman said in court Thursday, "It is possible that he has never had his bipolar disorder properly treated," as he outlined Yerkovich's documented mental health issues and recent treatments.

Donnell drew a distinction between mental health issues and the legal definition of insanity, but acknowledged Yerkovich's past problems and subsequent progress.

"I don't doubt that he has mental health issues," Donnell said.

Tangeman said Yerkovich works full-time and takes construction work on the side. He also said Yerkovich's family has a history with bipolar disorder, and Yerkovich now supports his father.

Yerkovich had a 3.7 GPA in high school, Tangeman said, and has done all the right things to address his mental health issues since he was arrested.

In his statement to the court, Yerkovich apologized to his family, the pharmacist, and Donnell.

"From the bottom of my heart, I am truly sorry for what I did that night," Yerkovich said, adding that the "The last seven months have been the best I've ever felt," due to the medication and other treatment he has received.

Prosecutor Kurt Britzius described it as an "odd case" and requested the split sentence agreed upon in the plea bargain.

"What he did was violent and dangerous," Britzius said. "The state would ask for a long term of supervision."

Before handing down the sentence, Donnell explained that he would likely have sentenced Yerkovich to the supervised probation Tangeman requested if Yerkovich's well-being was the only consideration at sentencing.

"The simple fact is, you do something like this, then there has to be some degree of punishment," Donnell said. "This isn't just about you or your best interests. This is about the lady that you scared to death; this is about the people you endangered."

"What do you think would have happened if a police officer had walked in there?" Donnell asked.

"I probably would have been shot, your honor," Yerkovich replied.

"The fact that you're doing well now, apparently," Donnell said, "is certainly commendable." But, he added, "I have to consider how you endangered the public as well."