One of Spain’s busiest airports shut down for nearly four hours on Friday after an apparent attempt by migrants to enter the country illegally.

A plane flying from Casablanca in Morocco to Istanbul, Turkey, was diverted to Palma de Mallorca after a medical emergency was reported aboard.

When the jet landed, 21 passengers ran off across the runways, reportedly escaping over the perimeter fence.

Police later made arrests but 12 were still on the run on Saturday.

Police are investigating whether the group’s escape from the plane was spontaneous or an elaborate plot to immigrate illegally.

The top Spanish government official for the Balearic Islands, Aina Calvo, said the event was unprecedented for a Spanish airport.

The drama began when emergency services boarded the Air Arabia Maroc plane to evacuate a Moroccan man said to have fallen into a diabetic coma. As they did so, 21 other passengers ran down the steps and fled, reportedly hiding under parked planes.

After a health check at a hospital found him to be fit and well, the Moroccan man was discharged and arrested for illegally entering the country, Spain’s Efe news agency reports. A fellow passenger accompanying him to the hospital disappeared.

Most of the escapees who were arrested were found by the Guardia Civil, the Majorca Daily Bulletin reports, noting that “one was caught walking along the road to Manacor”.

Some 60 national and international flights were diverted or delayed as a result of the incident.

The Air Arabia Maroc plane later continued to Turkey with its remaining passengers.