Two Libyan men who hijacked a plane from Libya to Malta and threatened to blow it up have surrendered peacefully, allowing 118 passengers and crew to leave the aircraft before walking out alongside the last of the crew.
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 on Friday morning.
Malta state television said the two hijackers possessed hand grenades and had threatened to detonate them.
All flights to Malta International Airport were immediately diverted and emergency teams including negotiators were sent to the airport tarmac.
Malta's prime minister, Joseph Muscat, announced that the hijacking of the Libyan plane was over in a tweet at 3.44pm local time (2.44pm GMT).
They have surrendered, been searched and taken into custody, he said.
The hijackers, after negotiations, allowed the plane's doors to open at 1.44pm (12.44pm GMT) and a staircase was moved over to let freed passengers begin disembarking in groups.
In a series of tweets, Mr Muscat said 65 people were allowed to leave, then another 44, including some crew, followed by the hijackers and the final crew members. All were seen leaving the aircraft without hand luggage.
The company said on its Facebook page that 118 people, including seven crew members, were on board the hijacked plane.
Ali Milad, the pilot, told Libya Channel TV network that initially the hijackers had asked him to head to Rome.
He identified the two hijackers as Moussa Shaha and Ahmed Ali, Libyans who other officials said were in their twenties.
The pilot said the men were seeking political asylum in Europe and wanted to set up a political party called "the New Fateh".
Fateh is a reference to former Libyan dictator Muammar Gaddafi, who led the Fateh revolution after his coup in 1969.
After many of the hostages left the plane on 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. Gaddafi was ousted and killed by a mob in 2011.
Western nations view the newly-formed UN-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 the chaos, Islamic State (IS) and al Qaida affiliates have gained a foothold over the past years.
Earlier this month, militias answering to the UN-brokered government seized IS's last stronghold in the Libyan city of Sirte.