A Buffalo man accused of selling a deadly dose of fentanyl will spend up to 20 years in prison.

A federal judge sentenced 40-year-old Carlique DeBerry in court Wednesday.

The U.S. Attorney's Office says in 2016, DeBerry sold a person in Hamburg a dose of heroin that caused a fatal overdose.

A police officer then posed as the victim to arrange another drug deal.

The investigation involved agents from the DEA and Hamburg Police.