At least 15 Mexican soldiers were held captive for hours by some 300 residents of a remote area of the Mexico-Guatemala border after one of the soldiers shot and killed a citizen at a checkpoint.

Mexican Defense Secretary Luis Cresencio Sandoval said on Tuesday that the incident is a flawed reaction from Mexico's military personnel.

The said personnel fired on a vehicle that was turning away from a checkpoint, according to a Connecticut Post report.

The soldiers that were seized were later on released after Mexican officials agreed to economic reparations and legal proceedings against those who were responsible for the death of the Guatemalan citizen.

Guatemala's Foreign Affairs Ministry identified the victims as Elvin Mazariegos. Mazariegos was a Guatemalan citizen living in the Mexican border of the Mazada de Madero.

"We demand Mexican authorities clear up the crimes committed against our countrymen to give them justice and so that these condemnable acts are not repeated," Guatemala Foreign Affairs Minister Pedro Brolo tweeted.

Sandoval denied claims that some of the soldiers were taken into the Guatemalan area.

Guatemala army spokesman, on the other hand, confirmed it.

The Guatemalan government also released photos of Mexican soldiers with Guatemalan police, who were said to be there to guarantee their safety.

READ NEXT: 4 Mexican Cops Charged With Salvadoran Woman's Death in Mexico

The Incident

The victim's vehicle went into reverse after approaching the checkpoint. One soldier had opened fire, according to The Guardian report.

Sandoval said that the soldiers tried to treat the wounded person. However, he died. Soldiers then detained the vehicle.

After that, about 300 area residents arrived and demanded justice.

Sandoval said that they attacked the personnel verbally and with rocks and sticks. At this time, the soldiers and their vehicles were seized, including their guns.

Holding security forces captive is not uncommon in remote Indigenous communities where residents feel they have little other options, according to an ABC News Go report.

Mexican military commanders negotiated with residents, and nine soldiers were released by 5 p.m.

Sandoval said that the other six with their vehicles and weapons were taken to a farther area but did not cross the Guatemala border.

Guatemala army spokesman Ruben Tellez said that the negotiations were successful, and at 3:20 a.m. The six soldiers and their weapons were turned over to Mexican authorities, which was done at the border between Guatemala and Mexico.

This incident took place two days after local police in the Mexican Caribbean resort town of Tulum was involved in the killing of a Salvadoran woman while trying to arrest her in a case that brings similarity from the case of George Floyd in the U.S.

Mexican prosecutors involved in the case of the Salvadoran woman said that an autopsy showed the police had broken the woman's neck and would be charged with femicide.

A footage was released on social media, wherein a female police officer knelt on Victoria Salazar's back while she was being restrained.

Three other officers are seen standing around her body.

READ MORE: Cases of Femicide in Mexico Continue to Increase

WATCH:  Mexico migrant killings: Guatemalan families mourn the dead - from Al Jazeera English