A divided federal appeals court in San Francisco ruled Tuesday that a U.S. Border Patrol agent can be sued by the family of a Mexican teenager, who was shot to death in a 2012 cross-border incident.

Border Patrol agent Lonnie Swartz had sought qualified immunity, arguing that he was on American soil when he fired on 16-year-old Jose Antonio Elena Rodriguez in Nogales, Mexico. But the appeals court accepted the family’s explanation the boy was not committing any crime or posing any threat to the federal officer, despite assertions by Swartz’s attorneys that Elena Rodriguez was lobbing rocks across the border during a drug smuggling attempt.

“[Elena Rodriguez] was not suspected of any crime, was not fleeing or resisting arrest and did not pose a threat to anyone, the use of force was unreasonable under the Fourth Amendment,” the court stated in its 72-page opinion, adding that no reasonable officer could have thought that he should shoot the boy.

The 2-1 majority added, “We cannot imagine anyone whose conscience would not be shocked by the cold-blooded murder of an innocent person walking down the street in Mexico or Canada by a U.S. Border Patrol agent on the American side of the border.”

The ACLU, which was representing the family, applauded the decision.

“The court made clear that the Constitution does not stop at the border and that agents should not have constitutional immunity to fatally shoot Mexican teenagers on the other side of the border fence,” said Lee Gelernt, deputy director of the ACLU's Immigrants' Rights Project. “The ruling could not have come at a more important time, when this administration is seeking to further militarize the border.”

Swartz fired 16 shots late on Oct. 10, 2012, through a 20-foot fence that sits on an embankment above Mexico's Calle Internacional, a Nogales street lined with homes and small businesses.

During a month-long criminal trial earlier this year, prosecutors acknowledged that Elena Rodriguez was lobbing rocks across the border during a drug smuggling attempt, but they argued he did not deserve to die for it. Swartz’s attorneys countered that the Border Patrol agent was justified in using lethal force against rock-throwers and shot from the U.S. side of the border in self-defense.

A mistrial was declared in April after an Arizona jury acquitted Swartz of a second-degree murder charge.

The Border Patrol came under close scrutiny during the Obama administration for allegations involving excessive use of force. Customs and Border Protection, its parent agency, reported 55 incidents in which employees used firearms from Oct. 1, 2011, to Sept. 30, 2012. The number of incidents fell to 17 for the same period five years later.

The killing of Elena Rodriguez was also felt deeply in the twin communities of Nogales, where about 20,000 people live on the Arizona side and about 300,000 in Mexico. The communities are linked by family members, trade and culture and have long been referred to locally as "Ambos Nogales" - "Both Nogales" in Spanish.

Fox News' Andrew O’Reilly and The Associated Press contributed to this report.