ST. CHARLES, Ill. — A 30-year-old suburban Chicago man has been given a 15-year prison term for trying to sell cocaine near a church.

The Kane County state’s attorney’s office said Monday that jurors convicted William M. Ingram in July. The Elgin man’s convictions included unlawful possession of a controlled substance with intent to deliver within 1,000 feet of a church.

Prosecutors say police recognized Ingram driving in a lot in 2014 and knew he didn’t have a license. They later found cocaine on the ground next to the door. They also found $4,700 in cash on him.

Ingram was sentenced Friday. Ingram could reduce his sentence with good behavior, but his legal troubles are far from over. He’s also facing a first-degree murder trial in a 2015 homicide.