The shooting began shortly after 10 a.m., officials said. An officer arriving at Memorial Drive Tire & Auto, an auto repair shop, was met by a barrage of gunfire, which left his vehicle riddled with bullet holes, the authorities said.

“By the grace of god, he did not sustain any injuries,” Chief Montalvo said.

During the shootout, one deputy constable was shot in a hand and the other in his tactical vest, the police said. The conditions of the other people who were injured were not immediately known.

Neither suspect was identified. John Cannon, a spokesman for the Houston Police Department, described the dead gunman as the “main active shooter,” who is believed to have fatally shot the person in the vehicle, then fired at the police officers and a Police Department helicopter.

That gunman was fatally shot by a member of Houston’s SWAT team.

The role of the second gunman was less clear. “We’re trying to figure out what his role in this was,” Officer Cannon said during a news conference. “Was he a suspect, or someone who happened to be armed with a gun?”

Asked if the police regarded him as a suspect, he said, “We’ll say he is a suspect because he had a gun.”