NEW YORK — The call came in just after dark Tuesday — a masked man with a gun was robbing a T-Mobile store in Queens, holding two employees in a back room.

Within minutes, the first police officers arrived, and two officers and a sergeant ran inside, officials said. More officers pulled up outside. The man in the store advanced quickly toward the officers inside, pistol raised. They retreated out of the store.

Then everything went wrong.

Seven officers opened fire toward the store — a total of 42 shots within 11 seconds, police said. “It goes from zero to 60,” said Chief Terence Monahan, the Police Department’s highest-ranking uniformed officer.

When the barrage of gunfire ended, two men lay bleeding on the sidewalk outside the store.

Neither was the robber.

They were brother officers, struck in a crossfire of police bullets.

Detective Brian Simonsen, 42, a 19-year veteran, was fatally shot in the chest, the police commissioner said. He was the first New York City police officer to be killed in the line of duty since July 2017. The sergeant who was struck, Matthew Gorman, 34, underwent surgery for a gunshot wound to his hip and was expected to recover.

The robbery suspect was identified as Christopher Ransom, 27, of Brooklyn, an eccentric man with a history of prior arrests for minor crimes whom police were looking for in connection with another robbery. He was shot eight times, police said, and was in stable condition at New York Hospital Queens. He was charged with murder and robbery.

New details released Wednesday gave some shape to the confusing initial accounts of the chaotic event.

Simonsen and his boss, Gorman, were among the first to reach the store. Gorman and two uniformed officers entered the store at 6:12 p.m., Deputy Chief Kevin Maloney of the Force Investigation Division, said Wednesday.

Ransom emerged from a back room and raised the imitation pistol, walking toward them, Maloney said. The three officers retreated outside, and Ransom walked to the store’s front door. He made motions as if he were firing the gun at the officers outside the store.

Seven officers opened fire. Simonsen fired twice, and Gorman 11 times, police said. Five other officers fired 29 shots among them.

“We don’t know at this point who shot who,” Monahan said.

This article originally appeared in The New York Times.