MANCHESTER — A psychiatric patient held at Elliot Hospital’s emergency department while awaiting admission to the state’s psychiatric hospital is accused of attacking a security officer Wednesday, repeatedly punching the guard in the face until the officer subdued him with pepper spray and after exchanging blows.

Both the patient and security guard — a retired, decorated New Hampshire state trooper — suffered “significant” facial injuries during the assault that police say bears strong similarities to the July 8 attack on two Elliot Hospital nursing assistants by a mentally ill patient also waiting for a bed to open at New Hampshire Hospital, the state’s acute psychiatric hospital in Concord. One of the employees in the earlier attack suffered critical injuries that required lengthy hospitalization.

Hospital security officer Lawrence Bolduc, 49, was able to defend himself against Fernando Ornelas’ repeated punches Wednesday night and pinned Ornelas to the floor until other security officers and a Manchester police officer hired by the hospital to provide extra security came to his aid, police said.

“Although there was an altercation with this patient last evening in the emergency department, for the safety of staff and the patient, the Manchester Police Department took custody of him,” Whitcher added in a three-sentence statement.

The hospital’s media staff would not say how long Ornelas had been in the emergency department waiting to be transferred to New Hampshire Hospital. They referred all other media inquiries to law enforcement authorities.

There were 25 adults and three children waiting to be admitted to the state-run psychiatric hospital Wednesday morning, the hospital’s acting chief executive officer Richard C. Willgoose said. That number grew to 27 adults and two children on Thursday morning, he said.

New Hampshire Hospital has been at 100 percent capacity with a waiting list for several years, Willgoose said. The hospital has 158 beds.

The hospital’s waiting list reached its highest number ever on Sept. 3 with 49 adults and three children logged, Willgoose said.

The lack of available beds at New Hampshire Hospital has emerged as one of the most critical issues facing the mental health system in New Hampshire, as mentally ill people suffering dangerous episodes can wait for days in local emergency rooms until a bed opens at the state-run facility.

The severity of the issue and the dangers it poses to hospital staff gained widespread attention July 8 when Ansel Kinglocke, 34, of Manchester allegedly attacked Elliot Hospital licensed nursing assistants Donald Wyman and Melissa Clermont while waiting to be involuntarily committed to the state-run hospital.

Kinglocke had been held at Elliot three days waiting for a bed to open up at New Hampshire Hospital when he allegedly attacked Wyman, stole his employee key card, then attacked Clermont while trying to escape. Wyman suffered critical head injuries in the attack. Clermont suffered a broken cheek bone. Kinglocke faces several assault charges and is undergoing hearings to determine if he is competent to stand trial.

Ornelas was being held in Elliot Hospital’s secured psychiatric evaluation unit, which is part of the emergency department, awaiting transfer to New Hampshire Hospital, police said. He allegedly “became increasingly agitated during his stay,” disturbing other patients. Bolduc asked him to return to his room and, while walking him back, Ornelas allegedly attacked him. Other security officers and Manchester Police Office Paul Rondeau came to Bolduc’s aide, handcuffed and arrested him.

Rondeau happened to be working a security detail in the emergency department when the incident occurred about 7:25 p.m. Wednesday.