An on-duty, uniformed police officer was shopping in a Philadelphia GameStop when two men burst into the store to rob it, authorities said. The police officer was killed in an ensuing shootout inside the store.

Officer Robert Wilson III and the two suspects, believed to be brothers, "engaged in a fierce and violent gunbattle" Capt. Darrell Clark said on Friday. Wilson was shot multiple times and killed when he was shot in the head.

More than 50 rounds were fired in about 30 seconds by the three men Clark said, according to WCAU-TV of Philadelphia. Civilians were inside the store as the gun battle raged, though none were shot.

Wilson shot one of the suspects in the leg before he was killed. The two suspects were later identified by witnesses and arrested. They have been charged with first-degree murder. Police said both confessed and said they chose the GameStop for the robbery believing it to be an easy target.

GameStop franchises are routinely targeted by criminals, and robberies there have even involved hostage situations, with staff and customers sometimes bound or locked in back rooms. It is very rare, however, that one ends in a fatality, much less a fusillade of 50 shots fired.

In a statement posted to its Facebook page, GameStop offered its condolences to Wilson's family and its gratitude for his actions during the shootout.

"The Company is thankful that due to the brave actions of Officer Wilson and the Philadelphia Police Department, all of our employees and customers are safe and unharmed."

Police said Wilson was shopping at the GameStop for a gift for his 8-year-old son because the boy had done very well in school. Wilson has another son, who is 1 year old.

"What parent probably hasn't done that for a child in recognition of good work and he just happens to be there at the time that these two guys come in there for a robbery," Charles Ramsey, commissioner of the Philadelphia police, said on Friday.