WASHINGTON (AP) — The Supreme Court ruled 5-4 Tuesday to close the courthouse door on the parents of a Mexican teenager who was shot dead over the border by an American agent.

The court’s five conservative justices held that the parents could not use American courts to sue Border Patrol Agent Jesus Mesa Jr., who killed their unarmed 15-year-old son in 2010.

Justice Samuel Alito wrote for the court that the case is tragic, but that strong border security and international relations issues led to the ruling against the parents of Sergio Adrian Hernandez Guereca.

“Since regulating the conduct of agents at the border unquestionably has national security implications, the risk of undermining border security provides reasons to hesitate” about allowing the parents to sue in American courts, Alito wrote.

Justice Ruth Bader Ginsburg, writing for her liberal colleagues, disagreed, saying the parents’ lawsuit does not endanger border security or U.S. foreign policy.

Tuesday’s outcome also is certain to doom a lawsuit filed by the parents of a teenager killed in Nogales, Mexico, from gunshots fired across the border by a U.S. agent. That case has been on hold.

The case tested a half-century-old Supreme Court decision that allows people to sue federal officials for constitutional violations. Over the years, the courts have made it harder to bring claims, known as Bivens actions after the name of the high court case.

Ginsburg wrote that “it is all too apparent that to redress injuries like the one suffered here, it is Bivens or nothing. I resist the conclusion that ‘nothing’ is the answer required in this case.”

Justice Clarence Thomas, who was part of the court majority, said he would get rid of Bivens lawsuits altogether. Justice Neil Gorsuch joined Thomas’ separate opinion.

Alito noted that the Justice Department and the parents disagreed about the sequence of events that led to Sergio’s death. But there is no question that Mesa was standing on the U.S. side of the border when he fired into Mexico and killed him with a gunshot wound to the face.

The family said Sergio was playing a game with friends on a June evening, running through a culvert and over the border, touching it, and running back. Mesa rode up on a bicycle, took Sergio’s friend into custody, then fired across the border.

The Justice Department said Mesa was trying to stop “smugglers attempting an illegal border crossing” and fired his gun after he came under a barrage of rocks. Mesa said in court filings that Sergio was among the rock throwers. Video footage of the incident seems to dispute that.

U.S. officials chose not to prosecute Mesa, and the Obama administration refused a request to extradite him so that he could face criminal charges in Mexico. When the parents of the boy tried to sue Mesa, federal judges dismissed their claims.

The Border Patrol drastically changed its use of force policies in the years after the shooting, following several complaints of excessive force. There were 15 instances where officers and agents used firearms during the budget year 2018, down from a high of 55 reported during the 2012 budget year.