SPOKANE, Wash. -

A Spokane Valley man is expected to spend the next five years in prison after pleading guilty to stealing almost a quarter of a million pain pills from Sacred Heart Medical Center.

This is undoubtedly the largest diversion of pain medication in Spokane history, carried out by 24-year-old Paul Martsin, who blew a lot of his profits gambling in local casinos. Now Sacred Heart has implemented a number of new safeguards, including security cameras focused on pharmacy employees.

Last May Sacred Heart pharmacists realized they were missing 230 jumbo-sized bottles of hydrocodone and called the Spokane Police Department.

"They asked the Spokane Police Department and the special investigative unit to help them out with the investigation to where these pills were going," Spokane Police Officer Teresa Fuller said.

There are a finite number of people allowed in the hospital's pharmacy and Martsin soon became a person of interest. Martsin had recently purchased a $36,000 car and was a regular gambler at the Black Pearl Casino where, in the first five months of 2013, he lost more than $10,000. It's money police think he made off of selling stolen hydrocodone pills.

"The money thing is what gets these people going into finding ways that they can get these pills, whether it's robberies or somebody that has an in at a pharmacy," Fuller said.

In Martsin's case the "in" was his job as a pharmacy technician. Investigators say he ordered far more hydrocodone than the hospital would ever need and then stole the new shipments when they arrived.

"The quantity that he was stealing in the period of time that he's been stealing it, even if you go to the low number on what they're getting on the street for these is a substantial amount of money," Spokane Police Captain Dan Torok said.

Sacred Heart issued a statement Wednesday regarding the matter, saying, "We take seriously our commitment to ensuring a safe and secure pharmacy operation and will continue to improve our processes and take every measure to prevent this from happening again."

To that end there are a lot more people now involved in auditing the pharmacy's inventory. For example, now you have one person ordering new pain killers and someone totally different receiving them.

Martsin was able to steal the pills because he did both.