A $1 million settlement has been reached in a lawsuit against U.S. Customs and Border Protection (CBP), seven years after the death of a Mexican man near the San Ysidro Port of Entry.

Anastasio Hernandez-Rojas, 42, died in 2010 after he was caught coming into the U.S. illegally and was involved in an altercation with border officers.

According to the Justice Department, Hernandez-Rojas began fighting with agents when his handcuffs were removed and he struggled and kicked them. One officer used a stun gun on Hernandez-Rojas after which his breathing slowed and he became unresponsive.

He was taken to the hospital and died a few days later.

According to his autopsy, Hernandez-Rojas suffered a heart attack during the altercation. The Justice Department said heart disease, electric shocks from the stun gun and methamphetamine intoxication were contributing factors.

Hernandez-Rojas' death raised complaints of excessive force from the then-president of Mexico and others, and investigators with the Justice Department examined the case for evidence of a civil rights violation.

But in 2015, the Justice Department announced that it would not bring criminal charges against the CBP and closed the investigation.

A year later, the CBP's Use of Force Review Board (UFRB) began to review the investigation into the deadly incident.

On Thursday, a settlement was reached in the lawsuit alleging wrongful death, excessive force and failture to properly supervise and failure to intervene.

The $1 million settlement will be paid to the plaintiffs, who are Hernandez-Rojas' children and wife, after the petition is approved.