A 23-year-old man slashed a woman in the face on Sunday morning in Queens, the police said, before fatally stabbing a shopkeeper and setting another man on fire several hours later at a nearby liquor store, leading to a wild manhunt that ended with officers shooting the suspect as he threw a chemical at them.

The man, James Patrick Dillon, refused to drop a knife and was spewing accelerant from a Corona bottle at a police lieutenant and an inspector when they shot him several times around 5:40 p.m. in his backyard in the Astoria neighborhood, the police said. He was taken to a nearby hospital with gunshot wounds to his leg; the lieutenant and inspector, who sustained chemical burns from the accelerant, were taken to a different hospital in stable condition.

The attacks, and the subsequent manhunt, turned a peaceful stretch of businesses and brick homes into a scene of panic and confusion. Officers snaked through backyards and alleyways with their hands on their guns as helicopters circled overhead and residents ducked for cover amid gunfire.

Mr. Dillon is accused of killing George Patouhas, 55, the owner of the liquor store, who was known for his friendly greetings and his lenient payment plans. Despite his easy manner, he was often harassed by an aggressive group of men, including Mr. Dillon, some customers said.