Two hijackers of a Libyan aircraft with 118 people on board surrendered to authorities on the island of Malta hours after claiming to have hand grenades and threatening to blow the plane up unless their demands were met.
Maltese Prime Minister Joseph Muscat said on Twitter that all passengers and crew had been safely released by Friday evening.
The hijackers, Muscat said, had "surrendered" and been "searched and taken in custody".
One of the hijackers told the flight crew of the Afriqiyah Airways plane that he was "pro-Gaddafi". Former Libyan leader Muammar Gaddafi was killed in an uprising in 2011, and the country has been racked by factional violence since.
It was unclear what the demands had been.
Hours after landing, people could be seen disembarking from the aircraft.
Tim Diacono, a journalist from Malta Today, told Al Jazeera the hijackers had grenades and "threatened to blow the plane up".
The last major hijacking on the tiny Mediterranean island of Malta was in 1985, when Palestinians took over an Egyptair plane. Egyptian commandos stormed the aircraft and dozens of people were killed.
Security personnel took up positions a few hundred metres from the plane as it sat on the tarmac on Friday.
Malta-based journalist Karl Stagno-Navarra said one of the hijackers had appeared at the door of the plane waving a large green flag - similar to the old Libyan flag under Gaddafi's rule. After a few moments he put the flag down and returned inside.
"This is not an issue of international terrorism, this is an issue of internal feud that is still ongoing in Libya," Stagno-Navarra said.
The aircraft had been flying from Sebha in southwest Libya to Tripoli for state-owned Afriqiyah Airways, a route that would usually take about two hours.
The Afriqiyah Airways plane was diverted towards Malta, but turned back as far as Libyan airspace before changing course again and flying to the Mediterranean island, an airline official said.
Malta is about 500km north of the Libyan coast.
Prime Minister Muscat also tweeted that the passengers on board the plane included 82 men, 28 women and one infant.
The pilot of the Afriqiyah Airways plane told the control tower the aircraft had been hijacked, a senior security official at the airport said.
"The pilot reported to the control tower in Tripoli that they were being hijacked, then they lost communication with him," the official told Reuters, speaking on condition of anonymity.
"The pilot tried very hard to have them land at the correct destination but they refused."
Reports said the two hijackers were in their mid-20s and were from the Tebu, an ethnic group present in southern Libya from where the plane departed. (Aljazeera)