His two sons in medical school, his five grown daughters in Pakistan and his wife home in Montgomery County, Abdul Ghaffar was working the overnight shift at a 7-Eleven in Gaithersburg early Thursday. A man walked in wearing sunglasses at 1:45 a.m. He asked for a hot dog, put it his pocket and went into the men’s room.

The 63-year-old clerk returned to his store duties, straightening out the coffee section. The man came out, approached Ghaffar from behind and grabbed him.

“An attack out of the blue,” Montgomery County prosecutor Robert Hill said in court Friday at a bond review hearing for the alleged assailant, a 36-year-old man named Shaun King who has a history of mental illness.

King used a razor-styled knife to slash and stab Ghaffar about 75 times, Hill said.

Authorities said King stood over Ghaffar’s body for six minutes as Ghaffar bled profusely from his neck, face and wrists. King left the store just as police officers were arriving.

Shaun David King (Montgomery Police Department)

“By all accounts, he was a peaceable, loving man,” Hill said of the victim, who also worked shifts at another 7-Eleven store in the area.

The grisly slaying was the third in a week in Montgomery County that involved suspects with an apparent history of mental illness. It prompted county State’s Attorney John McCarthy on Friday to speak out on the issue, saying society needs to do more to address the intersection of mental health and public safety.

In Montgomery County, McCarthy said, fewer people are being jailed but a higher percentage of those who are need psychiatric help. “As we have had the de-institutionalization of many individuals across America, there has not been a response and adequate funding at state and federal and local levels for the mental health challenges that face us,” he said.

In 2013, about 28 percent of the 7,879 people booked into the Montgomery County jail — or 2,221 detainees — needed immediate mental health intervention, McCarthy said. “Ask anybody who is a jailer in America, these are the largest mental health hospitals in the United States: our jails.”

As for King, he also has a long criminal history. In 1999, he was cited for possession of drug paraphernalia, according to court records. That was followed by convictions for disorderly conduct, resisting arrest, possession of marijuana and trying to escape from police during an arrest in late 2012, according to court records.

Last year, according to prosecutors, he was admitted to Shady Grove Adventist Hospital in Montgomery County for an emergency mental health evaluation.

And King’s attorney, Mary Siegfried, said in court Friday that her client has a history of mental illness and is on a suicide watch in the county jail.

Early Thursday, King entered the 7-Eleven where Ghaffar and a second clerk were working. His behavior seemed strange enough that after he went into the bathroom the clerks talked about keeping an eye on him, Hill said.

But neither one of them could have predicted such an attack. King grabbed Ghaffar around his throat and started slashing him in his head, face, neck and wrists, according to police and prosecutors. The second clerk hit a panic button, ran from the store and called 911.

The police officers who arrived spotted King just outside the 7-Eleven. They found a bloody box-cutter-style knife in his pocket. Inside the store, they found Ghaffar, who was taken to a hospital, where he died.

“He was not aggressive. He was passive,” Prakash Dulal, another 7-Eleven worker, said earlier.

Law enforcement officials have said Ghaffar was simply in the wrong place at the wrong time. They have not said what the motive was in his killing, nor is it clear whether they know.

“There’s no indication the defendant knew this man,” Hill said. At the conclusion of Friday’s hearing, District Judge Eugene Wolfe ordered that King be held without bond and that he undergo a mental health evaluation at the jail — specifically to help determine whether he understands his surroundings enough to stand trial.