Tucson, Arizona (CNN) A federal judge Tuesday declared a mistrial in the closely watched case of a humanitarian aid worker charged with three felonies for helping a pair of undocumented migrants who authorities said entered the United States illegally.

After three days of deliberations, jurors told US District Court Judge Raner Collins that they were unable to reach a verdict against aid worker Scott Warren, who was charged with one count of conspiracy to transport and two of "harboring illegal aliens." Jurors were split 8-4 in favor of acquittal on all three charges, said Warren's attorney, Greg Kuykendall.

Warren, who volunteered for the group No More Deaths, faced up to 20 years in prison.

After the mistrial was declared, Warren told reporters that the work he and others do along the border to help migrants must continue.

"Since my arrest in January 2018, at least 88 bodies were recovered from the Ajo corridor of the Arizona desert. We know that's a minimum number and many more are out there and have not been found," said Warren, adding that "it remains as necessary as ever for local residents and humanitarian aid volunteers to stand in solidarity with migrants and refugees."

"It's not the best outcome for us, but we'll take it," said the defendant's father, Mark Warren, who attended the trial.

Prosecutors accused Scott Warren of hiding two men for several days in January 2018 at a property called The Barn, at one edge of the town of Ajo, 40 miles north of the US-Mexico border. No More Deaths is one of several humanitarian aid groups that use The Barn as a staging area for search-and-rescue operations and for the placement of water and food along migrant trails.

Through May of this year, the Pima County Medical Examiner reported finding the remains of 58 presumed border crossers in the deserts of Southern Arizona, bringing the total reported over the past two decades to roughly 3,000.

During his initial instructions to the jury, Collins pointedly said this case was "not a referendum on immigration policy."

And prosecutor Nate Walters insisted the case shouldn't be seen as a judgment of humanitarian assistance to migrants in general: "No More Deaths is not on trial," Walters said in his opening statement. "Scott Warren is."

But even the basic terms each side used -- "illegal aliens" vs. "undocumented migrants" -- reflected a divide. Over a week, the larger political context for Warren's actions proved inescapable.

Assistant US Attorney Anna Wright argued that, in Warren's alleged conspiracy, "one goal was to thwart the Border Patrol at every possible turn."

Defense attorney Greg Kuykendall told jurors that "there is no evidence in this case that Scott intended to violate the law. The evidence is the opposite" -- that Warren simply wanted to prevent deaths.

During the trial, several founders of No More Deaths testified to their efforts to develop legal and medical protocols for the group's work, based on those of other humanitarian aid groups such as the International Red Cross. Andy Silverman, an emeritus professor of law at the University of Arizona who helped develop the protocols, said the group trained volunteers thoroughly, shared the protocols with the Border Patrol, and met regularly with the agency in part to ensure "we do things in a proper and a legal way, we do things transparently."

The Border Patrol declined to comment on meetings with No More Deaths or on the protocols, citing pending litigation.

But another No More Deaths volunteer, Geena Jackson, said that the cooperation went only so far. "I have seen Border Patrol agents dumping out gallons of water" left for migrants, Jackson said.

Prosecutors objected successfully several times when Warren's attorneys tried to show jurors photos or videos of migrants' remains, or to have witnesses describe them in detail. But when Warren took the stand in his own defense, Walters questioned him aggressively about a Washington Post opinion piece Warren wrote just before the trial. Walters said it was misleading for Warren to say desert temperatures could reach 120 degrees when the two men Warren helped had crossed in the winter.

That opened the door for Kuykendall to have Warren read the entire piece to the jury on the stand, with the judge's permission. Warren was able to air his argument that the case might set a dangerous precedent, and that the Trump administration is expanding the definitions of "transportation" and "harboring" in ways that could criminalize not only humanitarian aid work but potentially the daily lives of millions of families in which one partner is undocumented and another is a citizen. If prosecutors had hoped to leave aside the context of the Trump administration's attempts to crack down on migrants, the reading of the op-ed brought that bigger picture back into the courtroom.

Walters and Wright relied heavily on circumstantial evidence to argue that Warren conspired and hid the two men, who have since been deported. They cited phone records that showed Warren spoke to an immigration activist, Irineo Mujica, three times on January 11, one day before the two young men crossed the border from Mexico. Warren was the first person to show up at The Barn on January 14, the day that Mujica drove the two men there from a gas station in Ajo.

Gas station videos showed the two migrants could have had food and drinks the day they showed up, which prosecutors said suggested they weren't in medical distress and didn't need to stay at The Barn for days.

Border Patrol agents testified that they saw Warren pointing out landmarks as the men were getting ready to leave on January 17. Prosecutors suggested that he was helping them avoid a Border Patrol checkpoint.

Warren said he was helping orient the men so they would not get lost in the desert.

Jurors heard that Mujica, who was not indicted, was the founder of a migrant shelter in Sonoyta, Sonora, just south of the Arizona border. Mujica was arrested by Mexican federal police in Sonoyta on Wednesday for allegedly transporting migrants illegally, according to a press release from the Mexican government, though this was not mentioned at the trial.

Warren testified that he spoke with Mujica about recovering remains Mujica knew of in the desert, and about an upcoming visit by volunteers bringing supplies to the shelter. The defense showed jurors emails demonstrating that Warren was regularly in touch with Mujica about such matters.

In a video shown to jurors by the prosecution, one of the two migrants, Kristian Perez-Villanueva, said Mujica told the two men to tell anyone who asked that "we came by ourselves, alone, on our own." After walking for two days through the desert, he said, they waited at the gas station to be picked up and driven to The Barn. Perez-Villanueva said that Mujica didn't tell them to ask for anyone, nor did he mention Warren, and that no one told them to hide or what to do if Border Patrol agents came to the house.

Kuykendall, the defense attorney, said in his closing statement that the prosecution's idea of "a far-flung conspiracy" based on the evidence they put forth "makes no sense."

Warren testified that in his volunteer work he always followed the law. "How could you not do it," he said of his work helping migrants, "living in a place where people are dying by the dozens around you every year. How could you not respond?"

There was no suggestion by prosecutors that Warren benefited in any way from the alleged conspiracy. But Wright, the prosecutor, argued that Warren "had an interest in furthering Kristian and Jose's illegal trip," and that his aim "was the furtherance of the goals of his organization" in helping people complete their journeys to the US.

In the end, jurors could not agree on whether Warren was guilty of any of the charges.

Collins set a hearing for July 2. Prosecutors declined to say whether they would seek to retry Warren.

Correction: This story has been updated with the correct year of Warren's arrest.