DES MOINES, Iowa (AP) — An Iowa man who opened fire on officers serving a warrant pleaded guilty to federal gun and drug charges.

Randall Comly, 52, is scheduled to be sentenced June 12 in U.S. District Court in Des Moines. He pleaded guilty this month to possession of methamphetamine for sale and two weapons charges.

Comly is accused of firing a handgun at officers on Oct. 17 as they tried to arrest him inside a Stuart apartment complex. The officers weren’t hit, and they fired back, wounding Comly. The officers’ shots also injured two deputies posted outside the building, investigators have said. A Stuart police officer suffered a minor gunpowder burn in the shootout, the investigators said.

Stuart is about 35 miles (57 kilometers) west of Des Moines.