PHILADELPHIA — A retired Philadelphia police narcotics officer has pleaded guilty to swapping drugs for sex with two women, including one who was accused of driving under the influence in a crash that killed her grandmother.

Stanley Davis entered the plea agreement Friday to one count of distribution of controlled substances.

Federal prosecutors say 50-year-old Davis was working in Kensington, a neighborhood hard-hit by the opioid epidemic, when he approached the two women, ostensibly for drug-trafficking information. Prosecutors say he eventually started giving them crack and heroin for sex, which happened in New Jersey motels and his police-assigned car.

Davis’s lawyer told The Philadelphia Inquirer it’s impossible to know if Davis supplied the drugs the woman allegedly took the day of deadly the crash.

Davis’s lawyer says his client deeply regrets his actions.

He’ll be sentenced Dec. 8.