José Antonio Elena Rodríguez was on Calle Internacional, four blocks from his home in Nogales, when 16 shots punctured the night. Ten bullets struck him: eight in the back, two in the head. He died where he fell.

The 16-year-old was not a victim of street crime. All the shots came from the United States, from the gun of a Border Patrol agent aiming through the fence which separates Arizona from Mexico.

It was 10 October 2012, when a young life ended and a closely watched legal saga began. A single question threaded a family’s grief and argument about border security and the US constitution: was it murder?

The agent, Lonnie Swartz, said he fired in self-defence against rock-throwing drug smugglers. Prosecutors said the agent calmly, deliberately and unlawfully took a life, acting as judge, jury and executioner, and that his uniform should not shield him from justice.

On Monday, a jury in a federal courtroom in Tucson, Arizona, found Swartz not guilty of second-degree murder and said it could not reach a verdict on two lesser manslaughter charges.

Rodríguez’s grandmother left the courtroom in tears.

Watchdogs and activists condemned the result. “Today’s verdict demonstrates the persistent obstacles to accountability in Border Patrol that remain, particularly when it comes to use of force,” said the Kino Border Initiative, an advocacy group. It cited six other people killed on Mexican soil by Border Patrol agents.

“All of those who are responsible for these deaths are free from punishment, and none of the victims nor their family members have ever been afforded a path to justice.”

Cronica Nogales, a Nogales blogger, tweeted: “Inconceivable … unpardonable.”

In a statement Border Patrol’s parent’s agency, US Customs and Border Protection (CBP), said it respected the judicial process’s role in maintaining public trust through preserving the agency’s integrity, accountability and transparency. “Every employee is held to these standards and is responsible for their actions regardless of rank, position or length of service.”

Swartz has been on unpaid leave since being indicted in 2015. The delayed trial began last month and lasted 16 days. Swartz faced 20 years to life in prison if convicted of second-degree murder.

The jury deadlocked last Friday after three days of deliberations. The US district judge Raner Collins told jurors they could consider voluntary manslaughter, with a maximum of 20 years in prison, or involuntary manslaughter, with a maximum of six years. Unanimity still proved elusive.

Prosecutors expressed disappointment and said they would consider whether to seek a fresh trial for manslaughter.

Araceli Rodriguez, the mother of José Antonio Elena Rodríguez. Photograph: Zuma/Rex Shutterstock

The case put a spotlight on whether the US constitution applied to foreign citizens on foreign soil and the culture and policies of Border Patrol before and since Donald Trump became president.

However, much of the testimony focused on the moments leading up to Swartz’s fusillade.

Both sides agreed on the basic facts: at about 11pm on 10 October 2012, two men climbed the border fence, followed by two other men hauling bundles.

Cameras detected them and police and Border Patrol agents responded to the scene. Some retrieved abandoned bundles with 22lb of marijuana, worth nearly $18,000. Others, including Swartz, confronted two men straddling the 18ft fence. Three people on the Mexican side started throwing rocks at the agents.

Some initial accounts said Rodríguez was not involved and merely walking home after playing basketball. He liked cloudy days, cookies and spending time with his sisters, his mother, Araceli Rodríguez, told the Guardian in 2015. “Even though he’s not here he’s still my son in spirit, in soul, in thoughts, in words.”

The prosecutors who sought to jail his killer accepted the teenager did throw rocks. But doing so did not pose a grave danger nor justify murder, said Wallace Kleindienst, an assistant US attorney. He argued that Swartz was “fed up” with people throwing rocks and opened fire not to “eliminate a threat” but “to eliminate a human being”.

It took the agent 34 seconds to empty his gun clip, move 45 feet, reload and fire three more bullets.

In emotional testimony, Swartz said he was frightened and fired after rocks appeared to hit a fellow agent and a police dog. “This has gotta stop. Somebody’s going to get hurt,” he recalled thinking. He said he aimed at what appeared to be two “shadowy figures” throwing rocks. After the shooting, he said, things went “gray” and he vomited.

Sean Chapman, a defence lawyer, said rocks could kill and agents had a right to defend themselves. “Yes, a gun is more powerful than a rock, but agents are authorised to respond in certain situations. That’s the mindset, that’s the way they’re trained.”

Allegations of Border Patrol brutality have grown since the agency ballooned from 4,000 agents in the 1990s to 21,000 agents, making it one of the Department of Homeland Security’s biggest branches. Prosecutions are rare; convictions more so.

Agents consider themselves the US’s first line of defence against dangerous drug and human traffickers.

Smugglers deploy children to hurl grapefruit-sized rocks to intimidate and distract agents, Vicente Paco, a Border Patrol spokesman, told the Guardian in 2016, indicating a rock-strewn roof in Nogales. “They pick up velocity and can do serious damage. If we start getting rocked, we have to make split-second decisions.”

The Border Patrol reported a sharp spike in assaults that year. However, an investigation by The Intercept this week said the agency had manipulated statistics and that the job had never been safer.

Trump, who wishes to expand the agency, blamed assailants last November after two agents were found injured and unconscious in Texas. The FBI later concluded the likeliest explanation was an accident.

A CBP spokesman said the agency acted decisively when any member failed to live up to its high standards. “To have even one agent tarnish the badge is not acceptable and CBP has taken many steps to increase accountability and transparency.”