Aircraft with 118 people on board hijacked by men claiming to have hand grenades who threatened to blow it up.

A Libyan aircraft with 118 people on board has been hijacked and diverted to Malta by two men claiming to have hand grenades who threatened to blow up the aircraft unless their demands were met.

Maltese Prime Minister Joseph Muscat said in all 109 passengers had been released by Friday evening, which would leave only two passengers, possibly the hijackers themselves. Seven crew members were also on board the flight.

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 were.

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”.

“We don’t know what the demands are, but the negotiations are under way,” Diacono said. “There are people leaving the airplane as we speak, so it looks like it is being resolved peacefully, but it’s still too early to tell.”

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 appeared at the exit 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. “It looks like the situation is quite tranquil and under control even though the aircraft is surrounded by the local security forces.”

All passengers aboard the plane were in good health, an unnamed official at the Libyan foreign ministry told the state news agency LANA.

The prime minister’s office confirmed a negotiating team was at Malta International Airport.

The #Afriqiyah flight from #Sabha to #Tripoli has been diverted and has landed in #Malta. Security services coordinating operations. — Joseph Muscat (@JosephMuscat_JM) December 23, 2016

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.

“According to radar information the plane was going to Malta, then it flew back as far as Tripoli airspace, then it turned back towards Malta again,” said Farouk al-Wifati, the head of the Afriqiyah Airways office in Tripoli’s Mitiga airport, where the flight was due to land.

Malta is about 500km north of the Libyan coast.

Prime Minister Muscat also tweeted the passengers on board the plane included 82 men, 28 women and one infant.

UN launches new round of Libya peace talks

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.