VALLETTA, MALTA— Hijackers have surrendered after diverting a Libyan plane carrying 118 people to the Mediterranean island of Malta on Friday and threatening to blow it up with hand grenades, Malta’s prime minister said.

The surrender came after tense negotiations, after which at least 109 people were allowed to leave the plane,.

The hijacked Airbus A320 flight, operated by Afriqiyah Airways, was travelling 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.

All flights to Malta International Airport were immediately diverted and emergency teams including negotiators were sent to the airport tarmac for what the Malta airport agency called an “unlawful interference.”

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 1:44 p.m. and a staircase was moved over to its door before passengers began disembarking in groups.

In a series of tweets, Maltese Prime Minister Joseph Muscat said 65 people were allowed to leave the hijacked plane, then another 44, including some crew. All were seen leaving the aircraft without hand luggage.

The company said on its Facebook page that 118 people, including 7 crew members, were on board the hijacked plane.

The spokesman for the UN-brokered government in Libya said the hijackers were two men in their twenties who were seeking political asylum in Europe. Ashraf al-Tulty told The Associated Press that the hijackers had grenades on board.

Al-Tulty spoke to the Associated Press over the phone from Tripoli.

He said a Libyan lawmaker, Abdel-Salam al-Marabet was on the diverted flight.

Another Libyan lawmaker from Sabha, Youssef Kalikori, told the AP that he had been talking by phone to al-Marabet, who said the hijackers were demanding “asylum in a European country where they can establish a political party named al-Fateh that represents the old (Libyan) regime.”

After many of the hostages left the plane Friday afternoon, someone, apparently a hijacker, waved the old green Libyan flag from the plane's doorway.

Libya, a sprawling oil-rich North African country, has been split between rival parliaments and governments, each backed by a loose array of militias and tribes, since its former dictator Moammar Gadhafi was ousted and killed in 2011.

Loading... Loading... Loading... Loading... Loading... Loading...

Western nations view the newly-formed U.N.-brokered government as the best hope for uniting the country, but Libya's parliament, which meets in the country's far east, has refused to accept it. Amid chaos, the Islamic State and al-Qaida affiliates have gained a foothold over the past years.

Earlier this month, militias answering to the UN-brokered government seized the Islamic State group's last stronghold in the Libyan city of Sirte.