An impounded ship belonging to the Spanish nongovernmental organization Proactiva Open Arms sits in the port of Pozzallo, Italy. (Alessio Tricani/AP)

MILAN — In March, a ship patrolling the central Mediterranean on a search-and-rescue mission saved 117 migrants — including a 3-month-old baby in urgent need of medical attention — and brought them to Sicily. For that act, the two leaders of the ship’s crew are now facing as much as five years in jail and potential fines of more than 1 million euros ($1.2 million).

Then, on Monday, a Sicilian judge gave the group running the search-and-rescue ship a major victory. The Italian government has demanded that rescued migrants be returned to Libya and forced NGOs to sign a "code of conduct" promising to do so. But Judge Giovanni Giampicciolo ruled that Proactive Open Arms, a Spanish migrant-rescue NGO, was correct in bringing migrants back to Italy because “Libya isn't yet capable of welcoming migrants rescued at sea [while] respecting their fundamental rights."

Giampicciolo also ruled that Proactiva Open Arms should have its ship returned as soon as possible. And while the two arrested crew members still face trial, Giampicciolo's decision sets a precedent for NGOs refusing to cooperate with Libyan authorities because of reports of human rights abuse in Libya. As the newspaper La Repubblica noted, the ruling was a “a defeat across the board” for the prosecution.

The rescue operation took place March 15 in international waters, 73 miles north of Libya. After the ship, operated by Proactiva Open Arms, picked up the migrants, it was approached by a vessel from Libya’s coast guard. The Libyans demanded that the rescuers hand the migrants over to them under the terms of agreement between Italy and Libya signed last year.

That deal tasked the Libyan coast guard with performing search-and-rescue operations and bringing migrants to detention centers in Libya rather than Italy. At the same time, the Italian government introduced the “code of conduct” for NGOs operating in Italy.

But, as both human rights groups and media outlets have documented, abuse of migrants is rife in Libya. “Libya, the biggest jumping-off point for migrants trying to reach Europe, is now home to a thriving trade in humans,” wrote The Washington Post's Sudarsan Raghavan last year. “Unable to pay exorbitant smuggling fees or swindled by traffickers, some of the world’s most desperate people are being held as slaves, tortured or forced into prostitution.”

Most NGOs have stopped their search-and-rescue missions in the central Mediterranean rather than return migrants to Libya or risk crippling penalties; Proactiva Open Arms was one of only two groups still rescuing migrants from the sea. And when the Libyan coast guard demanded custody of the rescued migrants March 15, the crew of the group's ship refused.

Instead, the ship headed toward Italy. On March 17, it docked in the Sicilian town of Pozzallo. The following day, local prosecutor Carmelo Zuccaro accused Proactiva Open Arms of aiding illegal immigration and had the ship confiscated. Marc Reig Creus, the ship's captain, and Ana Isabel Montes Mier, the head of mission aboard the vessel, were charged with aiding illegal immigration, a crime punishable not only by jail time but also a fine of up to 15,000 euros (or $18,000) for each migrant illegally transported.

According to local newspaper La Sicilia, Zuccaro also charged Reig and Montes with organized crime, which carries up to 15 years in prison, but the charge was rejected by the judge presiding over the arraignment.

Proactiva Open Arms maintains that the Italian government's code of conduct is not legally binding. “There is no law that could force us to hand human beings to Libyan authorities in international waters, especially since we have reason to fear that they will be abused,” the group's spokesman, Riccardo Gatti, said to The Post. The prosecutor’s office did not respond to requests for comment.

This post has been updated with additional information about the case against Proactiva Open Arms.

Read more:

After reports of abuse, Libya says West shares responsibility for migrant crisis

Italy claims it's found a solution to Europe's migrant problem. Here's why Italy's wrong.

In once-welcoming Italy, the tide turns against migrants