The fugitive, barricaded in his basement apartment, had shot a firefighter — the first time a New York City firefighter had been hit with gunfire in the line of duty in more than 20 years. The man had then kept negotiators on the phone for hours, and in three instances, he had fired his gun.

Still, the authorities said, the negotiators were hopeful. Friends had been summoned to talk to the man, a 38-year-old former convict named Garland Tyree who was wanted for violating parole, and his mother had been flown to New York from Delaware in a Police Department helicopter. In a phone call from outside the house, she told Mr. Tyree that she loved him.

Six hours after the standoff began, it sounded as if he would relent.

Instead, Mr. Tyree emerged from his Staten Island apartment on Friday wielding a fully automatic AK-47 and began shooting. The cadre of law enforcement officers that surrounded him returned fire, the police said, and Mr. Tyree was killed.

“This is a very challenging day for our first responders — for our police officers, for our firefighters, for our E.M.T.s,” Mayor Bill de Blasio said at a news conference on Staten Island after the standoff was over. “But it’s a day when they all handled their jobs in an exemplary fashion.