Libyan officials, though, believed the hijackers had more personal goals. A senior official with Afriqiyah, Capt. Abdelatif Ali Kablan, said they had demanded Schengen visas to travel in Europe. They did not seem to be linked to any of the radical Islamist groups, like Islamic State, that operate in Libya, he added.

“We feared they might be some of those ideological people, but that seems not to be the case,” Captain Kablan said by phone from Libya.

Throughout the crisis, Malta’s prime minister, Joseph Muscat, used Twitter to provide a running feed of information about the security operation, the orderly release of the passengers in batches of 25 and the eventual surrender of the two hijackers.

In a news conference later, Mr. Muscat said his security forces had found a pistol and a grenade on the hijackers, and discovered a second pistol in a subsequent search of the airplane, raising questions about security standards in Libyan airports.

Later, though, Mr. Muscat posted that the weapons were replicas.

It was the second hijacking this year of a passenger jet in the Mediterranean region. In March, an Egyptian man commandeered a domestic EgyptAir flight en route to Cairo and forced it to land in Cyprus, where he demanded the release of political prisoners in Egypt and a meeting with his estranged wife.

The crisis ended hours later with the surrender of the hijacker, Seif Eldin Mustafa, who turned out to be wearing a fake explosive vest fashioned from mobile phone cases that had been taped together. Some news outlets later nicknamed him the “lovejacker.”

In September, a court in Cyprus ordered the deportation of Mr. Mustafa to Egypt. His lawyers are resisting the order and seeking asylum for Mr. Mustafa, claiming that he could be tortured if sent home.