Follow CBSMIAMI.COM: Facebook | Twitter

MIAMI (CBSMiami/AP) — Selling illegal substances is never a good idea, especially when the buyers are undercover cops.

READ MORE: Texas school shooting reignites Florida partisan divide on guns

Two Florida men have been sent to prison for distributing hundreds of opioid pills to an undercover Miami police officer.

The Miami U.S. Attorney’s Office says in a news release that 50-year-old Oreste Abreu of Hialeah was sentenced to just over four years in prison and 39-year-old Daniel Lezcano-Morejon of Hialeah was sentenced to more than three years.

READ MORE: 2 killed In I-95 Crash In Pompano Beach; Northbound Traffic Shut Down

Both men pleaded guilty earlier to drug trafficking charges.

Investigators say the pair sold more than 800 hydromorphone pills to the undercover officer over several months in 2012. Hydromorphone is sold under the brand name Dilaudid, a powerful painkiller.

The case was investigated by the Drug Enforcement Administration and the Miami-Dade Police Department.

MORE NEWS: Gunman announced plan on Facebook minutes before school shooting, Texas governor says

(© Copyright 2017 CBS Broadcasting Inc. All Rights Reserved. The Associated Press contributed to this report.)