ARAPAHOE COUNTY, Colo. (KDVR) — A man convicted in the fentanyl overdose of a 3-year-old has been sentenced to 20 years in prison.

Antonio Espinosa-Tovar, 29, lived in an Aurora home with his girlfriend and her two children when one of the children took a fentanyl-laced oxycodone pill, according to the 18th Judicial District Attorney’s Office.

“Espinosa-Tovar admitted to investigators that he was currently out of work and had been selling pills to make extra money. He also admitted that he knew the child had taken a pill after he found half of a pill on the floor,” the DA’s office said.

The child survived the overdose, according to the DA’s office. Staff at Children’s Hospital Colorado were able to stabilize the child with three doses of naloxone, the opioid reversal drug.

A jury on July 27 found Espinosa-Tovar guilty of child abuse and possession with intent to distribute a controlled substance. Court records show he was sentenced on Thursday.

“We’re grateful that this 3-year-old child was able to recover following Mr. Espinosa-Tovar’s reckless actions,” District Attorney John Kellner said in a statement. “While this situation could have ended in tragedy, this man must be held accountable for putting innocent lives in danger. He made a careless choice to leave this deadly poison in a residence where young children were staying.”