Hijackers diverted a Libyan plane carrying 118 people to the Mediterranean island of Malta on Friday and threatened to blow it up with hand grenades, officials said. Tense negotiations ensued and within a few hours all passengers were free, and the hijackers reportedly in police custody without any violence.

The hijacked Airbus A320 flight, operated by Afriqiyah Airways, was traveling from the Libyan oasis city of Sabha to Tripoli when it was diverted to Malta midmorning on Friday.

Malta state television TVM said the two hijackers on board had hand grenades and had threatened to explode them.

Get Breaking News Delivered to Your Inbox

A Twitter account run by Maltese Prime Minister Joseph Muscat’s office provided a series of rapid updates on the situation after authorities established contact with the hijackers.

It wasn’t clear whether Muscat himself or one of his staffers was sending the tweets, but they first reported that the hijackers had released a “first group” of 25 passengers, consisting of women and children, and that another group of 25 were in the process of coming off the aircraft. Less than half an hour later, the twitter account reported that all passengers had come off the aircraft but there could still be two hijackers and some crew on board.

Finally Muscat’s office tweeted that all hostages were free, including the flight crew, and that the hijackers had been searched and taken into police custody.

Hijackers surrendered, searched and taken in custody. — Joseph Muscat (@JosephMuscat_JM) December 23, 2016

The TV Malta network reported that two hijackers on board the aircraft had threatened to detonate explosives or hand grenades.

Officials did not immediately say whether they believed the hijackers to actually be in possession of any explosives, but one passenger, a Libyan member of parliament, said he saw what appeared to be a grenade.

Malta sits just south of Sicily, Italy, due north of the Libyan coast.

Live video showed passengers coming off the plane over the course of a couple hours.

One of the hijackers reportedly told Libyan TV from the plane that he was the head of a political party in that country made up of supporters of the late Libyan dictator Muammar Qaddafi, who was killed after a Western-backed uprising in 2011.

Libya has since fallen into chaos, with half the country being controlled by an Islamist government and the other half led by the Western-backed, secular government.

One man, possibly one of the hijackers, briefly emerged from the cockpit to wave a green flag, a symbol of support for pro-Qaddafi factions in Libya.

The French news agency AFP said Maltese government ministers had confirmed that the two hijackers on the plane had requested political asylum in Malta.