Lonnie Swartz, left, walks to the U.S. district court building in Tucson. (Ron Medvescek/Arizona Daily Star/AP)

A U.S. Border Patrol agent was acquitted of murder in the shooting death of a Mexican teen who threw rocks at law enforcement officers during an attempt to smuggle marijuana to Mexico.

But the Arizona jury that acquitted Lonnie Swartz of second-degree murder Monday was deadlocked on lesser manslaughter charges. A mistrial was declared, and federal prosecutors are evaluating whether to retry Swartz on the manslaughter charges.

The verdict was reached after a month-long trial and 18 hours of deliberation over five days, the Associated Press reported.

The death of 16-year-old Jose Antonio Elena Rodriguez in 2012 caught the attention of human rights groups who said the case marked the first time a U.S. Border Patrol agent was prosecuted in a cross-border shooting.

Elena Rodriguez was killed Oct. 10, 2012, near a fence along the border separating Arizona and Mexico. Court records say he and others hurled rocks from the Mexican side to the U.S. side to keep border agents distracted while two drug smugglers attempted to cross into Mexico.

Swartz fired several shots, killing Elena Rodriguez, who was on Calle Internacional, a street that runs parallel to the border fence and is in Nogales, in the Mexican state of Sonora, the teen’s home town. The teen was shot 10 times, mostly in the back.

After a lengthy investigation, a federal grand jury indicted Swartz in 2015; he has been on administrative leave without pay ever since, according to the union that represents Border Patrol agents.

Prosecutors say that Elena Rodriguez was still alive when he fell to the ground. But Swartz kept firing, they said, even though Elena Rodriguez was no longer a threat.

During the trial in federal court in Tucson, prosecutors argued that Elena Rodriguez did not deserve to die.

Assistant U.S. Attorney Wallace Heath Kleindienst said during closing arguments that Swartz “was fed up with being rocked” because similar incidents had happened before, the AP reported.

“He was angry with those people who had been throwing rocks against the fence. It was not about eliminating a threat,” Kleindienst told jurors. “It was about eliminating a human being.”

Human rights groups argued that the teen, who was not armed, would not have posed a threat to Border Patrol agents, who were on the other side of a fence that towers several feet above the Mexican side.

Swartz’s attorneys, however, said his use of lethal force was justified because he was defending himself and his fellow agents. Tucson defense attorney Sean Chapman told jurors that there was no evidence that Swartz was “fed up.”

“From his first day in the Border Patrol, it had been ingrained in him that rocks were dangerous,” Chapman said, according to the AP.

Defense attorneys also say that, contrary to the prosecutors’ theory, Elena Rodriguez died immediately after the first shots. He fell, and Swartz kept shooting. That means, they argued, that Swartz should not be held criminally liable because he did not continue to shoot someone who was still alive and lying on the ground.

In this 2017 file photo, a portrait of 16-year-old Jose Antonio Elena Rodriguez is displayed on the Nogales, Mexico, street where he was killed. (Anita Snow/AP)

Defense attorneys point to findings by two Mexican pathologists who concluded that one of the first bullets hit Elena Rodriguez’s head while he was still standing, killing him instantly.

First Assistant U.S. Attorney Elizabeth A. Strange said in a statement that her office respected the jury’s decision in what she described as a “difficult case.”

Chapman, the defense attorney, did not respond to a call seeking comment.

Art Del Cueto, president of the union that represents Border Patrol agents, praised the acquittal.

“During this particular case, what we had was an individual that was involved in drug smuggling,” Del Cueto told The Washington Post. “He was throwing rocks at a federal agent, that way criminals could continue smuggling drugs and/or escape. That’s the reality of what we have here.”

The case struck a nerve among residents of Nogales, a city that straddles two countries.

The northern half of Nogales is in Arizona, while the southern end is in Mexico. The not-guilty verdict prompted protests, with activists chanting “No justice, no peace” Monday as they gathered outside the federal courthouse, the Arizona Republic reported. Some protesters wore black veils, while others held pictures of Elena Rodriguez as they marched in the streets of Tucson.

In 2014, the American Civil Liberties Union filed a federal lawsuit on behalf of Elena Rodriguez’s mother, Araceli.

“At a basic human level, our case challenges the notion that a U.S. border agent can stick a gun through a hole in a fence and shoot at Mexican kids 20 feet away, with no constitutional consequences,” the ACLU said. “And legally it raises significant questions about whether the U.S. Constitution can be applied extraterritorially.”

Swartz sought to dismiss the lawsuit, arguing that Elena Rodriguez was not entitled to constitutional protections because he was a Mexican citizen who died while on the Mexican side of the border. A judge ruled in 2015 that the lawsuit could move forward.

Swartz has appealed that ruling, and the case is still pending.

“Borders aren’t zones of human rights exclusion or exception,” said Clara Long, a researcher for Human Rights Watch, which filed a brief in support of the lawsuit. “U.S. law should not allow violent abuses at its border to go unpunished.”

Del Cueto, the union president, railed against a portrayal of Swartz as a violent man who killed a defenseless teen.

“Lonnie Swartz took the extra step to defend himself and to defend the life of fellow agents around; so he pulled out his weapon and fired at the threat,” Del Cueto said. “A lot has been said that he continued firing, but the threat had not ended. There was still rocks coming at the agents, still rocks coming at Lonnie, and he was shooting at the direction where the rocks are coming from.”

Read more:

Trump is sending National Guard troops to the U.S.-Mexico border

U.S. customs agency is so short-staffed, it’s sending officers from airports to the Mexican border

A woman flying back from France brought an apple through Customs. It cost her $500.