(Adds comments at news conference by PM)
By Chris Scicluna
VALLETTA, Dec 23 (Reuters) - Hijackers armed with a grenade and pistols forced an airliner to land in Malta on Friday then freed all their hostages unharmed and surrendered, after declaring their loyalty to Libya's late leader Muammar Gaddafi.
Television pictures showed two men being led from the aircraft in handcuffs. The prime minister of the tiny Mediterranean island, Joseph Muscat, tweeted "hijackers surrendered, searched and taken into custody".
The Airbus A320 had been on an internal flight in Libya on Friday morning when it was diverted to Malta, 500 km (300 miles) north of the Libyan coast, after a man told the crew he had a hand grenade.
A Libyan television channel reported it had spoken by phone with a hijacker who described himself as head of a pro-Gaddafi party. Gaddafi was killed in an uprising in 2011, and Libya has been racked by factional violence since.
Buses were driven onto the tarmac at Malta International Airport to carry away 109 passengers, as well as some of the crew. Television footage showed no signs of struggle or alarm.
After passengers had left the plane, a man briefly appeared at the top of the steps with a plain green flag resembling that of Gaddafi's now-defunct state.
Libya's Channel TV station said one hijacker, who gave his name as Moussa Shaha, had said by phone he was the head of Al-Fateh Al-Jadid, or The New Al-Fateh. Al-Fateh is the name that Gaddafi gave to September, the month he staged a coup in 1969, and the word came to signify his coming to power.
In a tweet, the TV station later quoted the hijacker as saying: "We took this measure to declare and promote our new party."
MP Hadi al-Saghir told Reuters that Abdusalem Mrabit, a fellow member of Libya's House of Representatives on the plane, had told him the two hijackers were in their mid-20s and were from the Tebu ethnic group in southern Libya.
Troops were positioned a few hundred metres (yards) from the plane as it stood on the tarmac. Several other flights at the airport were cancelled or diverted.
After the standoff ended peacefully, Muscat told a news conference there had been talks between Maltese authorities and the Libyan hijackers.
"We were not willing to negotiate until there was a surrender," he said. The men had been carrying a grenade and two pistols and asked for two Maltese negotiators to board the aircraft, but this was rejected.
"There has been no request for asylum by the hijackers," Muscat said.
A senior Libyan security official told Reuters that when the plane was still in flight on Friday morning the pilot told the control tower at Tripoli's Mitiga airport it had been hijacked.
"Then they lost communication with him," the official said, speaking on condition of anonymity. "The pilot tried very hard to have them land at the correct destination but they refused."
The aircraft had been flying from Sebha in southwest Libya to Tripoli for state-owned Afriqiyah Airways, a trip that would usually take a little over two hours.
The government of Malta said Prime Minister Muscat had discussed the hijack with Libyan Prime Minister Fayez al-Sarraj by phone.
The last major hijacking on the island was in 1985, when Palestinians took over an Egyptair plane. Egyptian commandos stormed the aircraft and dozens of people were killed. (Additional reporting by Ahmed Elumami in Tripoli, Ayman al-Warfalli in Benghazi, Aidan Lewis in Tunis and Robin Pomeroy and Alison Williams in London; writing by Andrew Roche; editing by Jeremy Gaunt/Richard Balmforth)