A federal appeals court says a US border patrol agent who fired across the border from Texas into Mexico and killed a teenager cannot be sued in US courts by the Mexican teen’s family.

The unanimous ruling was issued Friday by the full fifth US circuit court of appeals. The decision reverses most of an earlier 2-1 ruling by a three-judge panel of the court.

There’s no dispute the agent, Jesus Mesa Jr, shot 15-year-old Sergio Hernandez in 2010. At issue is whether the teen’s family could sue in US courts.

With support from the Mexican government, the teen’s parents argue they should be allowed to sue in US courts because Mesa was on American soil. But the fifth circuit said, among other things, that Mesa was entitled to immunity.