A Lackawanna man has pleaded guilty in Erie County Court to selling crack cocaine and illegally possessing a weapon, the District Attorney’s Office announced Wednesday.

Kenneth Morris, 35, of Franklin Street, pleaded guilty to second-degree criminal possession of a weapon, third-degree criminal sale of a controlled substance; two counts of third-degree criminal possession of a controlled substance, and fourth-degree criminal possession of a controlled substance, the office said.

His convictions stem from three incidents.

Police officers from the towns of Hamburg and Orchard Park and the city of Lackawanna seized a loaded, unlicensed semi-automatic pistol and crack cocaine packaged for sale during an Orchard Park raid on Sept. 20. Morris admitted the gun and drugs belonged to him, prosecutors said.

Morris posted bail after his arrest.

Morris sold 17 bags of crack cocaine on Feb. 14 in Lackawanna, and a warrant for his arrest was issued, according to the District Attorney’s Office.

When arrested on Feb. 27, Morris was found with crack cocaine, also packaged for sale.

Morris faces a maximum prison sentence of 15 years when sentenced Aug. 5 by Erie County Judge Michael L. D’Amico.