ROME — A German humanitarian group appealed Wednesday for Malta to take in 32 migrants who were rescued off Libya this week by the Ukrainian captain of a container ship.

The request came as Pope Francis, who is scheduled to visit Malta this weekend, encouraged the tiny European Union nation in the central Mediterranean Sea to welcome refugees in general.

The migrants were rescued Monday by the crew of a German merchant vessel and transferred to the Sea-Eye 4, which is operated by the German non-governmental organization Sea-Eye. The group hopes Maltese authorities will let the ship dock and disembark the passengers.

The merchant vessel Karina was sailing from Malta to Benghazi, Libya, when the crew became aware of a distress call and pulled the migrants to safety from a human smuggling boat foundering in the Mediterranean in 4-meter- (13-foot-) high waves, Sea-Eye said in a statement.

Sea-Eye quoted the Karina’s captain, Vasyl Maksymenko, as saying that “the boat was in grave danger of capsizing” when his vessel came to the rescue.

Sea-Eye 4 was about 50 hours away from reaching the stricken boat but later rendezvoused with the Karina and took aboard the rescued passengers, some of whom were suffering from dehydration and hypothermia, the NGO said.

A Sea-Eye spokesperson tweeted a “thank you” in Ukrainian for the captain.

Sea-Eye said its ship was aiming to obtain permission to dock in Malta, which has often turned down similar past requests to allow in migrants rescued from unseaworthy boats launched by Libya-based smugglers.

There was no immediate indication if Malta would grant Sea-Eye 4 port access.

Pope Francis is scheduled to visit Malta on Saturday and Sunday while on a pastoral pilgrimage. During his traditional Wednesday public audience, he cited Malta’s early history of being a welcoming place for the shipwrecked.

“In that bright land, I will be a pilgrim in the footsteps of the Apostle Paul, who was welcomed with great humanity after being shipwrecked while he was headed to Rome,’’ Francis said, referring to a celebrated episode in the history of the Catholic Church.

The pope said his trip would be an opportunity “to meet the inhabitants of a country that is in the center of the Mediterranean and in the south of the European continent, today even more involved in the welcoming of so many brothers and sisters in search of refuge.”

According to tradition widely noted in Malta, Paul was being taken to Rome to be tried as a political rebel in about 60 A.D. when the ship carrying him and more than 200 others was wrecked on the Maltese coast after a storm.

Separately, Germany on Wednesday announced it will stop training Libya’s coast guard because of concerns about its treatment of migrants. Humanitarian groups have long complained the migrants returned to Libya are sent to detention centers, where they face extortion, torture, and trafficking.

The pope has called the Libyan detention centers “lager,” using the German word for concentration camps, and has called on the EU to come to an agreement on migrants arriving at its southern borders across the Mediterranean Sea.