Two hijackers diverted a Libyan commercial plane to Malta on Friday and threatened to blow it up with hand grenades, Maltese authorities and state media said.

The plane landed at 10:33 a.m. (4:33 a.m ET). After hours of tense negotiations 65 passengers were allowed to leave the plane before a further 44 were released, the prime minister of Malta Joseph Muscat said.

Muscat then tweeted at 15:40 pm (09:40 ET) that the incident was over after the hijackers “surrendered” and were “taken into custody.”

All crew members left the aircraft with the hijackers, he said.

Afriqiyah Airways, the operator of the hijacked plane, had earlier said there were 118 people on board, including 111 passengers.

Special forces enter the hijacked Afriqiyah Airways airplane at the Malta International Airport on Dec. 23. Domenic Aquilina / EPA

The hijacker told crew he was "pro-Gadhafi" but it was unclear what his demands were. Former Libyan leader Muammar Gadhafi was killed in the Arab Spring uprising in 2011, and the country has been racked by factional violence since.

The Airbus A320 flight was traveling from the Libyan oasis city of Sabha to Tripoli when it was diverted to Malta.

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

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

Emergency teams were immediately dispatched to the site of what the Malta airport agency called an "unlawful interference" on the airport tarmac. All flights into Malta International Airport were diverted.

Malta's National Security Committee coordinated the hostage operation, a government statement said, and a negotiating team was on site.

An official from Afriqiyah Airways said the two hijackers had expressed a willingness to release the passengers but initially said they would keep the pilot.

The doors of the plane opened at 2:44 p.m. (7:44 a.m. ET) and a staircase was moved over to its door before passengers began disembarking.

Serraj al-Fitouri also told Dubai-based Al-Arabiya TV that one Libyan lawmaker was among the list of passengers. It was unclear whether the lawmaker, identified as Abdel-Salam al-Marabet, was actually on the flight.

The tiny Mediterranean island of Malta, a European Union member, is about 300 miles north of the Libyan capital Tripoli.