WASHINGTON (CN) — A Mexican family cannot sue the U.S. border patrol agent who shot across the border and killed their 15-year-old son in Mexico, the Supreme Court ruled Tuesday.

On a hot June day in 2010, 15-year-old Sergio Adrian Hernandez Guereca was playing with his friends in a cement culvert that serves as the dividing line between El Paso, Texas, and Juarez, Mexico. The border between the two countries runs down the middle of the culvert and a fence stands on the U.S. side.

Hernandez, who was Mexican, and his friends were playing a game that asked them to run up the side of the culvert and touch the fence before running back down.

As they were playing, they were spotted by Border Patrol Agent Jesus Mesa Jr. Hernandez fled under a railroad bridge that crosses the culvert as Mesa arrested one of the other boys.

Mesa, standing in Mexico, then pulled out his gun and shot at Hernandez, who was in Mexico. One of the bullets hit Hernandez in the face, killing him.

A Justice Department investigation found the shooting took place while smugglers, including Hernandez, were trying to cross the U.S. border and throwing rocks at Mesa. Relatives of Hernandez insist meanwhile that the teen was an innocent bystander.

The family filed a federal lawsuit in Texas, claiming Mesa had violated their son’s Fourth and Fifth Amendment rights. Initially a panel of the Fifth Circuit advanced the suit, saying Mesa was not immune under the Fifth Amendment.

But a full sitting of the New Orleans-based appeals court reversed and found he was entitled to immunity.

The case made it to the Supreme Court, which in 2017 directed the Fifth Circuit to reconsider its decision.

The Fifth Circuit reached the same conclusion the second time around, if on different grounds.

On Tuesday, the Supreme Court ruled 5-4 that the case raised a host of foreign policy and national security concerns that should not be addressed by a court.

“Because of the distinctive characteristics of cross-border shooting claims, we refuse to extend Bivens into this new field,” Justice Samuel Alito wrote in the majority opinion.

Protections that arose from the 1971 case Bivens v. Six Unknown Federal Narcotics Agents, which allows individuals to sue federal agents for using unnecessary force, would have to be extended by the court in order to allow the Hernandez family to seek relief, Alito said.

Because Hernandez was killed by an agent while on the Mexican side of the southern border, the precedent set by the Bivens ruling does not extend to this case, the majority found.

“Moreover, Congress has repeatedly declined to authorize the award of damages against federal officials for injury inflicted outside U. S. borders,” Alito wrote, saying lawmakers have more authority than courts to decide issues of national security.

The majority cited “the risk of undermining border security” as a cause for hesitation in expanding protections to include the ability to sue for damages in situations like cross-border shootings.

Alito was joined in his opinion by Chief Justice John Roberts and Justices Clarence Thomas, Neil Gorsuch and Brett Kavanaugh.

Justice Ruth Bader Ginsburg dissented, and was joined by the rest of the court’s liberal wing – Justices Stephen Breyer, Sonia Sotomayor and Elena Kagan.

“The Court speaks with generality of the national-security involvement of Border Patrol officers. It does not home in on how a Bivens suit for an unjustified killing would in fact undermine security at the border,” Ginsburg wrote.

The dissenting justices held that none of the statutes listed in the majority opinion should block the Hernandez family from bringing the case, and that the use of force can be challenged without the need to extend Bivens protections because the officer’s conduct occurred inside the U.S.

“I resist the conclusion that ‘nothing’ is the answer required in this case. I would reverse the Fifth Circuit’s judgment and hold that plaintiffs can sue Mesa in federal court for violating their son’s Fourth and Fifth Amendment rights,” Ginsburg wrote.