Ten Brazilian soldiers have been arrested after firing more than 80 bullets into a car carrying a family, killing one man and wounding two other people.

Evaldo dos Santos Rosa, 51, a musician and security guard, was driving the family to a baby shower on Sunday afternoon, when an army patrol opened fire on them in the low-income neighbourhood of Guadalupe.

Dos Santos’s wife’s stepfather and a passerby were both wounded; his wife, seven-year-old son and 13-year old goddaughter escaped injury.

The homicide detective Leonardo Salgado, who examined the scene and interviewed witnesses, told the Guardian soldiers had confused the family’s white car with another white car stolen nearby.

“They did not order it to stop, they started firing in an unjustified, inexplicable way,” he said. “Only a miracle stopped this tragedy [from] being worse.”

The army’s eastern military command initially said an army patrol had been attacked by criminals but on Monday it changed its position and said that due to “inconsistencies between the facts initially reported and other information that arrived afterwards” 10 of the 12 soldiers involved had been arrested for “disobeying the rules of engagement”.

Salgado said that when he reached the scene, furious locals were stopping other military personnel from examining the crime scene and the soldiers who fired had already gone.

“They refused to present the soldiers. They said that military prosecutors were dealing with the case,” he said.

The army said the soldiers were carrying out a “regular patrol” of the perimeter of a large military complex nearby and that the case is now with military courts and prosecutors.

Security specialists and activists said military courts are even slower and less efficient at investigating army killings than civil courts.

When the military were put in charge of policing in Rio state during a 2018 “federal intervention” homicides fell 7%, but deaths caused by state security agents soared 36%.

Ignacio Cano, a professor of sociology at the State University of Rio, said there was “no legal justification” for the military to try the case. “They should be investigated and prosecuted by civil police and civil courts,” he said.

Antônio Costa, the president of the not-for-profit group Rio da Paz (Rio of Peace) said comments by the far-right president, Jair Bolsonaro – who said last year that police officers should be decorated for killing criminals – encouraged violence by security officials. “His talk creates a warlike climate,” he said.