A doctor who lost his job at a New York City hospital opened fire with an assault rifle inside the building Friday, killing another physician and wounding six other people before taking his own life, officials said.

The gunman, wearing a white medical lab coat, stalked two floors of the Bronx-Lebanon Hospital Center and tried to set himself on fire before police searching the building found him dead of a self-inflicted gunshot, Police Commissioner James O'Neill said.

One female doctor was shot to death, and six other people were wounded, five of them seriously, including one who was shot in the leg, O'Neill said at a news conference.