(CNN) After four aid volunteers entered an Arizona wildlife refuge in 2017 and left jugs of water and cans of beans for undocumented migrants to find, the volunteers were found guilty of breaking federal law.

Now, a federal judge has overturned their convictions.

On Monday, US District Judge Rosemary Márquez ruled that the volunteers, who were part of the No More Deaths ministry of the Unitarian Universalist Church of Tucson, were acting on their sincere religious beliefs when they left food and water for migrants in the desert of the Cabeza Prieta National Wildlife Refuge

"Defendants met their burden of establishing that their activities were exercises of their sincere religious beliefs, and the Government failed to demonstrate that application of the regulations against Defendants is the least restrictive means of accomplishing a compelling interest," the ruling reads.

"Accordingly, the Court finds that application of the regulations against Defendants violates RFRA (the Religious Freedom Restoration Act), and the Court will reverse Defendants' convictions."

The Cabeza Prieta Wilderness , Arizona's largest wilderness area, spans about 803,000 acres of isolated and rugged landscape of the Sonoran Desert. The desert area is located near the US-Mexico border, and many undocumented migrants have died there of dehydration and extreme temperatures after trying to cross into the US.

Thirty-two sets of human remains were found on the refuge in 2017, the year that the volunteers were charged, according to No More Deaths

The organization states that its mission is to end "death and suffering in the Mexico--US borderlands through civil initiative."

Migrant remains are often found in that desert

CNN has called and emailed the US Attorney's Office in Arizona, which prosecuted the case, for comment on the ruling. Assistant US Attorney Heather Sechrist told the Arizona Republic that while it disagreed with the opinion, the office has not yet decided whether it will seek an appeal.

No More Deaths hailed the ruling as a victory.

"This ruling reaffirms what No More Deaths has always maintained: providing life-saving humanitarian aid is never a crime," No More Deaths volunteer Alicia Dinsmore said in a statement.

"The reversal of the convictions is a victory for all people of conscience and righteousness who seek to end the death and suffering in the borderlands."

Natalie Hoffman, Oona Holcomb, Madeline Huse, and Zaachila Orozco-McCormick were convicted on misdemeanor charges in 2019 for entering the federally controlled refuge without a permit and abandoning property.

Hoffman was also charged with operating a motor vehicle on a restricted access road.

A judge reversed the convictions of four No More Deaths aid volunteers who were found guilty of trespassing after leaving food and water in a wildlife refuge.

The volunteers were initially sentenced to 15 months of unsupervised probation, fined $250 each and banned from the refuge for the duration of their probation.

Their lawyers appealed the decision, citing the Religious Freedom Restoration Act, a 1993 federal law that requires the government to accommodate a person's religious beliefs when enforcing the law.

Though the Trump administration has emphasized protecting the religious liberty "to the greatest extent practicable and permitted by law," Justice Department lawyers rejected the assertion that the volunteers' actions were motivated by their faith, according to the Law, Rights & Religion Project at Columbia Law School.

"Judge Márquez's opinion marks a significant defeat for the Department of Justice in its effort to protect religious liberty rights only when they advance the White House's political agenda," Katherine Franke, faculty director of the Law, Rights, and Religion Project, said in a statement.

The latest ruling orders that the volunteers be acquitted and their sentences vacated. Any fines or fees that they paid will be returned to them and their probation will be terminated.