The man accused of fatally shooting a coworker at Thomas Jefferson University Hospital earlier this month has been deemed incompetent to stand trial by a court-appointed psychiatrist, his attorney said in court Monday.

As a result, Stacey Hayes, 55, will be required to receive mental health treatment at a state-run psychiatric hospital before his criminal case can proceed.

During a brief hearing Monday, Municipal Court Judge David Shuter said Hayes would be committed to Norristown State Hospital until at least December, at which point the courts are expected to revisit his health status and determine if his case can move forward. He remains in custody without bail on charges of murder, attempted murder, and related counts.

Prosecutors didn’t object to the decision and had no comment on it.

Hayes is accused of killing Anrae James, 43, his coworker and a certified nursing assistant, on the hospital floor where they worked, then fleeing the scene and starting a shootout with police in West Philadelphia not long after. Two officers were wounded in the gunfire, police said. Hayes — who police said was driving a U-Haul and wearing a bulletproof vest, and had several guns, including a semiautomatic assault rifle — was struck in the upper body and neck when officers fired back.

Hayes’ attorney, Gary Server, declined in an interview to provide details about Hayes’ mental health condition or discussions he’s had with his client. Attempts to reach Hayes’ relatives in the weeks after the shooting have been unsuccessful.

Police and prosecutors have said the investigation remains ongoing. Authorities and some coworkers of Hayes and James have said there was no clear animosity between the men, who had both worked the night shift at Jefferson for years.

The killing, captured on surveillance video, stunned workers at the busy hospital, and later forced Jefferson officials to admit that it took too long to notify staff of an active shooter situation.

Police said the crime occurred shortly after midnight Oct. 4, with surveillance video showing Hayes getting off an elevator on the ninth floor, walking directly toward James — who was seated at a workstation — and opening fire with what appeared to be a handgun.

Hayes then left the hospital and drove off in the U-Haul, police said. An hour later, around 1:25 a.m., a passerby flagged down officers in Parkside, near the School of the Future, saying a man in scrubs nearby had a gun and was possibly firing shots in the air.

Four officers approached Hayes and told him to drop his gun, police said, but he instead opened fire on them. The officers shot back, police said, and struck Hayes before taking him into custody.

James’ relatives said after the crime that they had no idea why Hayes may have targeted James. They described James as a hardworking father of three who worked two jobs — a certified nursing assistant and a part-time barber — to provide for his children. Attempts to reach family members Monday were unsuccessful.

Server, Hayes’ attorney, also declined to comment on whether mental health issues had played a role in a decision by authorities last summer to seize Hayes’ firearms. Hayes successfully petitioned a city judge this year to return his three guns, but court records do not indicate why they were taken in the first place.

Under state law, authorities can require someone to give up legally purchased firearms if they suspect the weapons were used in a crime; if the owner is committed to a behavioral health facility; or if that person is the subject of an active protection-from-abuse order.

Hayes is due back in court on Dec. 27 to determine the status of how and whether his case can proceed.