HAGERSTOWN, Md. (AP) — Police in Hagerstown, Maryland, are promising a thorough investigation into the death of a man in custody after officers shocked him with a stun gun outside a home he allegedly had broken into.

Witnesses said the officers acted professionally in taking down the man Thursday night as he cursed at police and ignored their commands to get down. An officer fired a stun gun from at least six feet away after the man moved toward him in an aggressive manner, said Robert Holmes, who said he watched the incident.

“They wasn’t physical or nothing like that. They were pretty much doing their job,” Holmes said.

Police said the man appeared to be under the influence of drugs. They said he remained uncooperative as he was handcuffed and placed in an ambulance.

“At some point, the suspect suffered an unknown medical emergency,” police said in a written statement. They said he was pronounced dead shortly after midnight at the nearby Meritus Medical Center.

Police have not released the man’s name. The Office of the State Medical Examiner will conduct an autopsy to determine the cause of death, said Officer Heather Aleshire, a police spokeswoman.

She said she was not aware of any video of the incident.

Nine-year-old Tera Gibbs said the man kicked in the door to her family’s row house and came upstairs, where she and her sisters sleep. Tera’s mother, Laura Mirfin, said she had gone out, leaving Tera and three sisters, ages 16, 14 and 13, at home.

Tera said the girls chased the man outside and called 911.

Police said the first call reporting a disturbance, with screaming in the background, came into the 911 center around 10:30 p.m. Thursday. A second caller reported that a man broke into her house, police said.

Police said two responding officers found the man in front of the home “in an aggressive stance” and he “appeared to be highly agitated. Two more officers and a supervisor arrived a short time later.

The department has asked the Washington County Sheriff’s Department to conduct the death investigation.

The suspect was Black and the officers involved were all White, police said. Race has not been raised as a factor in the death, but it comes amid a national debate about the deaths of black men at the hands of police.