A woman doctor gunned down by an ex-colleague ousted from a New York City hospital was not his intended target, authorities have said.
The new details of Dr Henry Bello's rampage emerged along with an email rant against colleagues he blamed for forcing him to resign from Bronx Lebanon Hospital amid sexual harassment allegations two years earlier.
Bello, 45, smuggled an AM-15 assault rifle hidden in his white lab coat past security in search of a colleague he was going to hold responsible.
But when that person was not there, he opened fire anyway, killing Dr Tracy Sin-Yee Tam, who was covering a shift as a favour.
Bello sent an email to the New York Daily News just two hours before the shooting on Friday afternoon that left six other people wounded and Bello dead from a self-inflicted shot.
"This hospital terminated my road to a licensure to practise medicine," the email said.
"First, I was told it was because I always kept to myself. Then it was because of an altercation with a nurse."
He also blamed a doctor for blocking his chances at practising medicine.
Bello had warned his former colleagues when he was forced out in 2015 that he would return some day to kill them.
A law enforcement official said Bello arrived at the hospital with the assault rifle under his coat and asked for a specific doctor whom he blamed for his having to resign, but the physician was not there at the time.
It was not clear if Bello knew Dr Tam, 32, who was killed in the shooting on the 16th and 17th floors of the hospital and was, like him, a family medicine doctor.
Hospital officials said Dr Tam normally worked in one of the hospital's satellite clinics and was covering a shift in the main hospital as a favour to someone else.
"It makes you think that anything can happen to anybody," said Dr Tam's neighbour, Alena Khaim, 23, who saw Dr Tam's sister outside the home on Friday night overcome with grief, shaking and unable to walk.
"She was such a sweet girl. You would never think something like that would happen but it happened."
Judy Beckles-Ross, 46, said she was not surprised Dr Tam volunteered to cover the shift.
"She never said no," said Ms Beckles-Ross, a friend from medical school who knew Dr Tam for 11 years.
"She had a good heart. Anybody that needed help, she would help them."
The six others injured - a patient, two medical students and three doctors - largely suffered gunshot wounds to the head, chest and abdomen.
One physician remained in a critical condition and the rest were stable, officials said.
Hospital vice president Errol Schneer said his staff responded heroically.
"Many of our staff risked their own lives to save patients," he said at the hospital where the 16th and 17th floors remained closed and staffers were still recovering from the rampage that sent people diving for cover and huddling in patients' rooms while the gunman was on the loose.
Adding to the chaos, authorities said, was a fire alarm that went off when Bello attempted to set himself ablaze. The flames were extinguished by sprinklers shortly before he shot himself.
Detectives searched the Bronx home where Bello was most recently living and found the box where the gun came from.
Investigators were checking serial numbers and trying to determine where it was purchased.
His former co-workers described Bello as aggressive, loud and threatening.
"All the time he was a problem," said Dr David Lazala, who trained Bello as a family medicine doctor.
When Bello was forced out in 2015, he sent Dr Lazala an email blaming him for the dismissal.
Dr Maureen Kwankam told the New York Daily News that "he promised to come back and kill us then".
According to New York State Education Department records, Bello graduated from Ross University and had a permit to practise as an international medical graduate that was issued on July 1, 2014, and expired last year on the same day.
In 2004, the doctor pleaded guilty to unlawful imprisonment, a misdemeanour, after a 23-year-old woman told police Bello grabbed her.
He was arrested again in 2009 on a charge of unlawful surveillance, after two different women reported he was trying to look up their skirts with a mirror. That case was eventually sealed.
Mr Schneer told the New York Times that the hospital did not know about Bello's criminal history when he was hired.
"At that time, and as a result of a human resources and security department background check, which includes fingerprinting, there was no record of any conviction for sexual abuse," he said.