PHOENIX — A federal appeals court has ruled that a Border Patrol agent who fatally shot a Mexican teen on the other side of the border doesn't have immunity and can be sued by the boy's family for violating his civil rights.

The ruling on Tuesday has wide implications and came almost two years after the agent's attorney argued he was immune from a civil lawsuit because the U.S. Constitution didn't extend to 16-year-old Jose Antonio Elena Rodriguez, who was in Mexico when agent Lonnie Swartz shot him about 10 times through a border fence.

The Border Patrol has said Elena Rodriguez was throwing rocks at Swartz, endangering his life.

The central question in the case is whether Elena Rodriguez was protected by the U.S. Constitution as a Mexican citizen on Mexican soil.

In a very similar case out of Texas, a different appeals court has ruled that a teen boy who was also fatally shot by an agent in a rock-throwing incident was not protected by the constitution. That case made its way to the U.S. Supreme Court, which appeared to be divided on the issue and which sent it back to the lower court without making a decision. The lower court then reaffirmed its decision that the boy wasn't constitutionally protected.

The 9th U.S. Circuit Court of Appeals said in its decision that the agent "violated a clearly established constitutional right and is thus not immune from suit."

The conflicting opinions in the different appeals courts, both of which cover cases on the U.S.-Mexico border, could mean the Elena Rodriguez case ends up back in the Supreme Court.

"This ruling is important both as to border shootings specifically, but more generally that the constitution does not have a hard stop at the border," said ACLU attorney Lee Gelernt, who is representing Elena Rodriguez's mother in the civil lawsuit. "It's an enormous victory for the family and I think for the rule of law at the border."

Swartz's attorney, Sean Chapman, did not immediately respond to requests for comment.

Elena Rodriguez was in the Mexican border town of Nogales near the international border fence when Swartz shot him from Nogales, Arizona, on Oct. 10, 2012.

An autopsy conducted in Mexico showed that Elena Rodriguez was hit about 10 times in the back.

The ACLU filed a lawsuit on behalf of the boy's mother in July 2014.

The case is similar to a 2010 incident when a Border Patrol agent in El Paso, Texas, fatally shot a teenager who was across the border in Ciudad Juarez, Mexico.

Agent Jesus Mesa Jr. was trying to arrest immigrants who had illegally crossed into the country when rock-throwers attacked him, according to authorities. Mesa fired across the Rio Grande river, striking 15-year-old Sergio Adrian Hernandez Guereca twice.

The 5th U.S. Circuit Court of Appeals first ruled in favor of Hernandez Guereca's family, then against them, before the case made its way to the Supreme Court last year. The high court sent the case back to the appeals court, saying it was best suited to make a decision, but that court dismissed the lawsuit for a second time in March.