Jonathan Hemming. (Montgomery County Police)

A man has been charged with attempted murder after he tried to shoot police officers with a homemade handgun, authorities said.

On May 18, detectives from the Montgomery County Police Department began surveillance on Jonathan Hemming, 52, of the 100 block of Spring Street in Gaithersburg, Md., who was wanted on drug-related charges, the department said in a statement.

At about 3:30 p.m., detectives tried to arrest Hemming in a vehicle in Gaithersburg, according to the statement, when he became combative and reached in the center compartment area of the vehicle and grabbed a homemade handgun. A Taser was deployed on Hemming after he pointed the gun at detectives, police said.

After Hemming was removed from the vehicle and placed under arrest, detectives determined the homemade handgun was capable of firing shotgun rounds, the statement said. A second homemade handgun was found in Hemming’s pants pockets, as well as shotgun shells and ammunition for a handgun, according to the statement.

Hemming was charged with two counts of attempted first-degree murder, two counts of attempted second-degree murder, assault charges, firearms-related charges and drug-related charges — 21 in all, police said. Hemming is being held without bond, according to police.