MEXICO CITY — Mexican marines accepted responsibility Friday for the deaths of three civilians killed when they drove through a running gun battle between marines and cartel gunmen in the northern border city of Nuevo Laredo in late March.

The Navy said it accepted responsibility after a prosecution ballistics expert found evidence that gunfire from a helicopter supporting the marines in a confused series of pre-dawn gun battles killed a female passerby and her two children. One marine was also killed in the gun battles and 12 were wounded. Four gunmen also died.

The Navy said in a statement that "this department accepts responsibility for this unintentional act which affected a car carrying civilians who were not connected to the events."

It said it would offer reparations and support to the victims' families. The father and one boy who were travelling in the car were wounded and survived. A girl was not hit by the bullets.

Expert Anselmo Apodaca of the attorney general's office said investigations concluded the bullets that hit the family's car came in through the vehicle's roof at a 45-degree angle.

Apodaca also said the car "was driving by chance in the line of fire of the shootout."

Photos of the scene showed a highway running through scrubby woods, with no apparent firing position offering a 45 degree angle down on the car's roof.

The car was apparently hit when it passed by a point where two truckloads of gunmen had pulled to the side of the road and opened fire; dead gunmen were found next to those vehicles.

In a statement issued one day after the March 25 shootout, the Navy had denied the family was hit by bullets from the helicopter, saying "preliminary investigations by competent authorities indicates the bullets that hit the civilians were from crossfire at ground level and not from the air."

The army, and to a lesser extent the marines, have been accused in the past of excessive or indiscriminate use of force, and of trying to cover up those abuses.

The acceptance by the Marines marks one of the first times the military has come out and said it was at fault.

Mexican military forces have been deployed to fight criminal gangs in the country's roughest areas, a law enforcement role which even they acknowledge they do not want and have not been trained.

In 2014, the killing by soldiers of 22 suspected criminals at a warehouse became one of the country's biggest rights scandals after a human rights investigation determined that at least 12 and as many as 15 people had been executed after surrendering.

No soldier has ever been tried and convicted in that case.

The March 24-25 gun battles illustrated the level of drug gang violence in Nuevo Laredo, a city dominated by the Northeast Cartel, an offshoot of the Zetas cartel.

Authorities said marines were ambushed three separate times in Nuevo Laredo, across the border from Laredo, Texas.

Marines returned fire and killed one gunman in the first attack, but suffered three wounded.

Another patrol was sent to help the wounded when it also came under fire; that ambush killed one marine and wounded several others.

A third patrol was ambushed just outside the marine base as it responded to the first two attacks. In that shootout, three gunmen were killed.

Finally, a helicopter gunship was called in.