A 27-year-old man accused of buying a gun used in the fatal shooting of a Detroit police officer was sentenced Tuesday to two years in prison, federal prosecutors said.

Sheldon Avery Thomas, 27, of Detroit pleaded guilty in December to making a false statement in buying the weapon that was used to kill Officer Loren Courts, 40, during a July ambush on Detroit’s west side.

Court documents and statements made in court showed Thomas on June 7, 2022, bought a pistol in Eastpointe, Michigan, and falsely certified he was the buyer of the firearm when he knew he was purchasing it for Ehmani Davis, prosecutors said. Thomas gave Davis the gun that same day.

MICHIGAN MAN ACCUSED OF KILLING WOMAN WITH CROSSBOW

Davis, 19, was not allowed to purchase a weapon because of his criminal history.

Michigan Fox News graphic

A Michigan man was sentenced to two years in prison for buying a gun that was used to kill a police officer.

Police said Davis, 19, fatally shot Courts on July 6 during an ambush as Courts and his partner were responding to a report of a man firing a weapon. Davis opened fire through the closed window of his apartment unit and a bullet struck Courts in the neck as he sat in a squad car, police said.

CLICK HERE TO GET THE FOX NEWS APP

Another officer fatally shot Davis.