Germany demanded Tuesday that Italy release the captain of a German aid ship and the head of a humanitarian aid group who were arrested after delivering 37 African shipwreck survivors to a port in Sicily.

In a move that threatened to spark a diplomatic confrontation, Italian police on Monday arrested Elias Bierdel, the head of the German aid group Cap Anamur, as well as the captain and a crew member of the ship, also named Cap Anamur, on suspicion of aiding illegal immigration.

They were detained and the ship was impounded after Italian authorities allowed the Cap Anamur to dock at Porto Empedocle, on the southern coast of Sicily, and permitted the refugees to disembark after the vessel sailed the Mediterranean for three weeks searching for a port of refuge.

Germany demanded their immediate release. "It cannot be accepted that Elias Bierdel should be punished because he wanted to help people who came upon big hardship," Development Minister Heidemarie Wieczorek-Zeul said Tuesday.

The aid group said it rescued the Africans from a rubber dinghy drifting in the Mediterranean after its engine failed, but Bierdel told Radio Vatican shortly before his arrest: "We believe that ultimately everything is based on misunderstandings. We have made mistakes, too, we have to admit."

Italian authorities initially refused permission for the ship to dock, saying the Africans were closer to Malta than Italy when they were picked up and should have applied for asylum there.

Hundreds of thousands of illegal immigrants land on Italy's shores every year, many of them planning to continue on to other European Union countries. Italy has requested greater E.U. cooperation to help crack down on the growing migration.

Members of Italy's opposition condemned the arrests and the transfer of the Africans to illegal immigrant detention centers. "Every minute, this issue is increasingly taking the shape of an international scandal," Alfonso Pecoraro Scanio, head of Italy's Green party, told reporters. "You can't confuse those who help refugees with those who trade in human beings."