Eastern Libyan military commander Khalifa Haftar arrived in Ankara on Tuesday for his first known visit to Turkiye, accompanied by two of his sons. The trip came two days after a Ukrainian strike hit a Russian warship in Benghazi, killing at least 10 Libyan and Russian crew members, according to local authorities.

Photos released by the General Command of the Libyan National Army (LNA) showed Turkish Chief of General Staff General Selcuk Bayraktaroglu greeting Haftar at the airport. There was no official media readout of the meeting. Reuters news agency reported that Haftar is set to meet Turkish President Recep Tayyip Erdogan.

Khaled and Belqasim Haftar travelled with their father, the LNA’s General Command said. Khaled is the LNA’s chief of staff, while Belqasim heads Libya’s Development and Reconstruction Fund. Saddam Haftar, the LNA’s deputy commander and heir apparent, was in Doha for a separate meeting with Qatar’s minister of state for defence.

The warship had docked in Benghazi, the main city in Haftar-controlled eastern Libya, to refuel and resupply under an agreement with the eastern authorities. Libya’s internationally recognised government in Tripoli condemned the attack on Monday, saying neither Russia nor Ukraine had the right to conduct military operations on Libyan territory or in its waters.

Turkish military support for Libya predates the Ukrainian attack. Ankara helped the then-Tripoli government repel Haftar’s forces’ offensive in 2019 and 2020. Since a United Nations-brokered ceasefire ended major fighting in 2020, Turkiye has built ties with Haftar’s camp while maintaining its alliance with Tripoli.

On Saturday, Turkish Foreign Minister Hakan Fidan and intelligence chief Ibrahim Kalin met Abdul Hamid Dbeibah, prime minister of Libya’s Tripoli-based Government of National Unity, in Istanbul. Fidan later told a Turkish television station that Erdogan will visit Libya in December after a 15-year hiatus.

Haftar’s Ankara visit follows a vote by Libya’s eastern-based House of Representatives, which approved a 2019 maritime deal with Turkiye just weeks earlier, reversing years of opposition. The vote was widely seen as an overture to Turkiye as power-sharing talks in the country stall.

Saddam Haftar is reportedly seeking the Libyan presidency, with backing from Washington. The United States is trying to broker a power-sharing proposal between Tripoli and Benghazi that would make Saddam chairman of the Tripoli-based Presidency Council (PC). The effort is championed by Massad Boulos, US President Donald Trump’s senior adviser for Arab and African affairs.

Powerful factions in Tripoli and the western city of Misrata oppose giving Saddam the post, Libya analyst Jalel Harchaoui told Al Jazeera. “The Turks are more pragmatic and realistic than Boulos,” Harchaoui said. Ankara takes that opposition seriously, he said, because trying to force the appointment could destabilise Libya.

Harchaoui said approval of the 2019 memorandum of understanding between Turkiye and Libya’s UN-recognised former Government of National Accord (GNA), on the delimitation of maritime boundaries in the Mediterranean Sea, was an effort by Saddam to secure Ankara’s backing for the council chairmanship. The European Union, Greece, Israel and Egypt condemned the vote.

Although Saddam was not at the Ankara meeting, Harchaoui said Erdogan’s invitation to his father gave the Turkish president another way to show progress in bringing Libya’s rivals together. As Erdogan prepares to visit Libya, he may seek a meeting between Dbeibah and Khalifa Haftar as Ankara pursues “a format of its own, calibrated to its own risk appetite and independent of the one Boulos has been pushing for months”, according to the analyst.