WASHINGTON – A deeply divided Supreme Court ruled Tuesday that the family of a Mexican teen shot and killed by a U.S. Border Patrol agent cannot seek damages because of the border that was between them.

The justices ruled 5-4 that Sergio Adrian Hernández Guereca, 15, lacked constitutional protection against the use of excessive force because he was in Mexico. Had he been in Texas with Border Patrol agent Jesus Mesa, his family would have had a claim.

Associate Justice Samuel Alito wrote the opinion and was joined by the court's four other conservatives. The four liberal justices dissented.

"A cross-border shooting claim has foreign relations and national security implications," Alito said. "In addition, Congress has been notably hesitant to create claims based on allegedly tortious conduct abroad."

Associate Justice Ruth Bader Ginsburg wrote the dissent for her liberal colleagues. She said the shooting occurred on the U.S. side of the border, so the majority's concern about applying the law abroad should not apply.

"Neither U.S. foreign policy nor national security is in fact endangered by the litigation," Ginsburg said. "Moreover, concerns attending the application of our law to conduct occurring abroad are not involved, for plaintiffs seek the application of U.S. law to conduct occurring inside our borders."

Hundreds of incidents involving deadly force occur along the U.S.-Mexican border every year. President Donald Trump has been trying to build a wall along the border and reduce both legal and illegal immigration.

Border Patrol agents in New Mexico train to respond to hostile crowds throwing rocks at a border fence on the U.S.-Mexican border.

In 1971, the Supreme Court gave private citizens an implied right to sue federal officials for civil rights violations, even though Congress had passed no such law. Associate Justice Clarence Thomas, joined by Associate Justice Neil Gorsuch, wrote Tuesday that the precedent should be overruled.

"Federal courts lack the authority to engage in the distinctly legislative task of creating causes of action for damages to enforce federal positive law," Thomas said. "We are exercising legislative power vested in Congress."

Story continues

During oral argument in November, Mesa's attorney, Randolph Ortega, said the border "is real. It's a real line. And it can't be extended" to provide constitutional protection on the Mexican side.

The case, which was heard twice by the high court, stemmed from an incident in 2010 when Hernández and friends were playing in a dry riverbed separating El Paso, Texas, from Ciudad Juarez, Mexico. Standing on the U.S. side, Mesa fired at least two shots across the border, striking Hernández in the face and killing him.

Mesa's lawyers said he was responding to a group of suspected undocumented immigrants throwing rocks at Border Patrol agents. Cellphone videos show Hernández unarmed and hiding beneath a train trestle when he was shot.

The boy's family sued, based on the case in 1971, when the Supreme Court said a homeowner could sue federal agents who forced their way into his home without a warrant. Judges have expanded on that precedent and allowed lawsuits against other federal officials.

The family's lawsuit was dismissed in lower courts, which ruled that Hernández did not have constitutional protection against unreasonable use of deadly force under the Fourth Amendment, as well as due process rights under the Fifth Amendment, because he was not in the USA.

When the case first was heard at the Supreme Court three years ago, the court issued an unsigned opinion that gave the teen's family another chance. It ruled that the agent was not entitled to immunity, but it punted issues back to a federal appeals court, which again dismissed the case last March.

In November, Ortega and Jeffrey Wall, the Justice Department's principal deputy solicitor general, argued that the death of a foreign national on foreign soil does not trigger Fourth Amendment protections. They said the case touched on foreign affairs and national security, both of which are under the domain of the executive branch.

Ginsburg asked how national security was involved in "using excessive force to kill a child."

In his ruling, Alito said the matter is best left to the executive branches of both countries, rather than the judiciary.

"Both the United States and Mexico have legitimate and important interests that may be affected by the way in which this matter is handled," he said. "It is not our task to arbitrate between them."

This article originally appeared on USA TODAY: Cross-border shooting: Supreme Court clears Border Patrol agent