Maltese authorities charged three young African migrants on Saturday with committing an act of terrorism for hijacking a vessel that rescued them off the coast of Libya.

The two teenagers from Guinea and one from Ivory Coast, aged 15, 16 and 19, are accused of forcing the Palau-flagged tanker Elhiblu I towards Malta after it picked up 108 migrants, including women and children, on Wednesday and headed towards its destination in Libya.

A Maltese special operations unit boarded the ship a day later, arrested five men suspected of leading the hijacking.

They handed control back to the captain who steered the ship to Valletta under a navy escort.

The three migrants, who were charged at a Maltese court with seizing control of the ship through the use or threat of force and intimidation, pleaded not guilty and were placed in preventive detention pending trial.

They face prison terms of between seven and 30 years if convicted.

The ship’s captain told Maltese media the hijackers “were desperate and absolutely did not want to return to Libya.”

“Panic and confusion erupted when the migrants understood that we were going back,” to a country where migrants face trafficking, kidnap, torture and rape according to the United Nations and aid groups.

Following Italy’s increasingly tough anti-migrant stance, vessels that pick up migrants crossing the Mediterranean increasingly return them to Libya.

Boatloads of rescued migrants have in recent months refused to disembark there, however, prompting local authorities to use force.