An ideologically divided Supreme Court ruled Tuesday that the family of a Mexican teenager killed by a Border Patrol agent in a cross-border shooting could not sue in U.S. courts, citing implications for American foreign policy and national security.

The court’s conservatives prevailed in the 5 to 4 ruling, in which the court for the second time considered whether relatives of foreign victims injured on foreign soil can go to court without express authorization from Congress.

The case began with the death of 15-year-old Sergio Adrián Hernández Güereca, who was fatally shot by a federal agent in 2010 on the Mexican side of the wide concrete culvert that separates El Paso from Juarez, Mexico.

Justice Samuel A. Alito Jr. wrote for his conservative colleagues, saying a respect for the separation of powers means that courts should be reluctant to allow lawsuits filed by foreign victims in U.S. courts without express congressional authorization.

“Petitioners protest that ‘shooting people who are just walking down a street in Mexico’ does not involve national security, but that misses the point,” Alito wrote. “The question is not whether national security requires such conduct — of course, it does not — but whether the judiciary should alter the framework established by the political branches for addressing cases in which it is alleged that lethal force was unlawfully employed by an agent at the border.”

Alito noted that the federal government did not find that agent Jesus Mesa Jr. had violated policy or move to prosecute him for the shooting and denied Mexico’s request that he be extradited to stand trial.

Alito was joined by Chief Justice John G. Roberts Jr. and Justices Clarence Thomas, Neil M. Gorsuch and Brett M. Kavanaugh.

While Alito said that filing a damages lawsuit based on a cross-border shooting “arises in a context that is markedly new,” Justice Ruth Bader Ginsburg said in a dissent that the majority had missed the point.

Mesa’s allegedly unlawful conduct occurred stateside, Ginsburg wrote, and no one disputes that Hernández’s parents could file if their son had been shot on U.S. soil.

“Hernández’s location at the precise moment the bullet landed should not matter one whit,” Ginsburg wrote, adding “there is still no good reason why Hernández’s parents should face a closed courtroom door.”

She was joined by the court’s other liberal members: Stephen G. Breyer, Sonia Sotomayor and Elena Kagan.

“In this case, justice doesn’t travel as far as a bullet does,” Robert Hilliard, who represented the family, said in a statement. “To be left with no remedy (‘nothing’ as Justice Ginsberg notes) given such a violent and unprovoked shooting, weakens the constitutional foundation of America’s house.”

American Civil Liberties Union lawyer Lee Gelernt, who represents another Mexican teenager shot by an agent in a separate incident, denounced the decision.

“The gravity of this ruling could not be clearer given the Trump administration’s militarized rhetoric and policies targeting people at the border,” Gelernt said in a statement. “Border agents should not have immunity to fatally shoot Mexican teenagers on the other side of the border fence. The Constitution does not stop at the border.”

Alito acknowledged the “tragic” events of the shooting.

When Hernández was killed, he had been playing with friends in a game some said was common along the border. The boys ran up a steep embankment on the U.S. side to touch a tall fence — and then raced back down the hill to Mexico.

Mesa claimed the boys were throwing rocks at him, but cellphone video of the incident indicated that that was not true.

Mesa grabbed one of Hernández’s friends at the top of the embankment and then, while holding onto him, fired at least two shots across the border, killing the unarmed Hernández.

Courts have struggled with the cross-border implications of the case. Hernández’s parents were attempting to sue under a 1971 precedent from the court, Bivens v. Six Unknown Fed. Narcotics Agents.

The court in that case allowed people to sue over unconstitutional actions by federal officials, even if such suits had not been explicitly authorized by Congress.

But since then, the court has been more likely to restrict so-called Bivens complaints than expand them.

“In later years, we came to appreciate more fully the tension between this practice and the Constitution’s separation of legislative and judicial power,” Alito wrote.

He added later in the opinion: “We have recognized that Congress is best positioned to evaluate whether, and the extent to which, monetary and other liabilities should be imposed upon individual officers and employees of the federal government based on constitutional torts.”

Thomas and Gorsuch filed a concurring opinion saying the court should overrule Bivens.

But Ginsburg responded that Congress is well aware of the court’s Bivens jurisprudence and has taken no action to restrict such claims.

“Rogue U.S. officer conduct falls within a familiar, not a ‘new,’ Bivens setting,” Ginsburg wrote, and none of the factors a court must weigh in deciding whether a case may move forward concerns “where a bullet happens to land.”

The case is Hernández v. Mesa.