Attacker, a former employee, killed one person and wounded six others before he was found dead by police.

A former employee of a New York City hospital opened fire with an assault rifle inside the building, killing one doctor and wounding six other people before fatally shooting himself, officials said.

The gunfire broke out at 2:50pm local time (18:50 GMT) on Friday inside the Bronx-Lebanon Hospital in the Bronx.

The assailant, wearing a white lab coat and armed with an assault rifle, stalked the 16th and 17th floors of the Bronx-Lebanon Hospital Center.

Police who swarmed the building found him dead of a self-inflicted gunshot wound after a search, they said.

One physician was shot dead in the course of the bloodshed, and six other people were injured, five seriously, including one who suffered a gunshot wound to the leg, Police Commissioner James O’Neill said at a news conference.

“The body of a woman who was shot was found near his body,” O’Neill said before adding that five of the wounded were in serious condition and “fighting for their lives”.

“The hospital’s fire alarm system went off during the siege, apparently because the shooter tried to set himself on fire,” he said.

New York Mayor Bill de Blasio characterised the shooting as an “isolated incident” that appeared to be “workplace-related”.

An NYPD official also confirmed on Twitter that the attacker died in hospital.

One shooter is deceased at the hospital. https://t.co/qgRQdwd33j — J. Peter Donald (@JPeterDonald) June 30, 2017

Television images showed the hospital surrounded by police cars and fire trucks. Police could be seen on the roof of the building, at one point, with their guns drawn.

Bronx-Lebanon Hospital describes itself as the largest voluntary, not-for-profit healthcare system in the south and central Bronx.

The 120-year-old hospital claims nearly 1,000 beds spread across multiple units.