People in the hospital described a chaotic scene as gunfire erupted. 

Employees locked themselves inside rooms and patients feared for their lives after an announcement that an armed intruder was loose in the building.

The intruder was a doctor forced from a New York hospital because of sexual harassment accusations.

He returned on Friday with an assault rifle hidden under a lab coat and shot seven people, killing one woman and leaving several doctors fighting for their lives.

The gunman, Dr. Henry Bello, fatally shot himself after trying to set himself on fire at Bronx Lebanon Hospital, they said. He staggered, bleeding, into a hallway where he collapsed and died with the rifle at his side, officials said.

"I thought I was going to die," said Renaldo Del Villar, a patient who was in the third-floor emergency room getting treatment for a lower back injury.

Law enforcement officials identified the shooter as the 45-year-old Bello, who was described on the hospital website as a family medicine physician. Officials said Bello used an AR-15 in the attack on the 16th and 17th floors.

Bello was allowed to resign from the hospital in 2015 amid sexual harassment allegations, according to two law enforcement officials. The officials didn't know the details of the allegations.

On Friday, one female doctor was killed and six other people were wounded, five of them seriously, according to Police Commissioner James O'Neill. The patients were treated in the emergency room at Bronx Lebanon.

Two surgeons at the hospital told the AP that all six victims were in critical condition, but they were expected to survive.

The victims largely suffered gunshot wounds to the head, chest and abdomen, they said.

The most seriously wounded was shot in the liver, said the surgeons, who spoke on the condition of anonymity because he was not permitted to speak publicly.