The hijackers have been searched and taken into custody, Muscat said. All passengers and seven crew on board have been released. Flight was scheduled to travel from Sabha to the Libyan capital, Tripoli. Incident caused flight diversions and delays.

Hijackers took control of the flight after it took off from Sabha, a desert city in southwestern Libya. The crew reportedly wanted to land the plane in the Libyan capital but the hijackers forced them to divert to Malta, some 350 kilometers from the Libyan coast in the Mediterranean Sea.

Emergency services and security personnel were on standby when the plane landed late on Friday morning. Contacts with the hijackers, who threatened to blow up the aircraft with hand grenades, were led by the Maltese military, according to a Foreign Ministry spokesman, Etienne Saint John.

By the early afternoon a group of women was allowed to leave the plane. Later, the remaining passengers and crew were seen leaving, smiling and chatting as they stepped off the plane and onto the tarmac.

Developments in the standoff were reported in real time by the Maltese prime minister’s Twitter account.

As the incident unfolded, several flights to and from Malta’s airport were delayed and some diverted to Italy.

Resident Carmen Nistor was waiting for her flight to Munich at the airport, saying passengers were frustrated as they had not been informed why there were delays.

Gadhafi loyalists

Sabha, the city where the flight began its journey, has been a center for political tribal violence.

Deadly clashes still erupt there between tribes loyal to Gadhafi and anti-Gaddafi groups. Enmity runs deep between the Gaddadfa and Suleiman tribes, the most powerful armed factions in the region.

Gadhafi, who was a member of the Gaddadfa tribe, was ousted from power and assassinated by rebels in 2011 in the Arab Spring uprising.

Libya has struggled to install a stable government since then, and the leadership vacuum has allowed militant groups like ISIS and Al Qaeda to flourish there.