President Recep Tayyip Erdogan received the commander-in-chief of the Libyan National Army in the country's east, Field Marshal Khalifa Haftar, at the Presidential Complex in Ankara on Wednesday.
The closed-door meeting was the first formal visit to Türkiye by the leader of the eastern half of divided Libya, according to the presidency.
Officials gave no details of the talks. The Communications Directorate confirmed that Haftar and his accompanying delegation were received, and Erdogan's office released a photograph of the meeting.
The encounter marks a thaw between longtime rivals. Türkiye backed the UN-recognized government in Tripoli against Haftar's eastern forces during Libya's civil war.
Turkish Foreign Minister Hakan Fidan, National Defense Minister Yasar Guler, National Intelligence Organization chief Ibrahim Kalin and Chief of the General Staff Gen. Selcuk Bayraktaroglu joined Erdogan.
Haftar's delegation included his son and presumed heir, Saddam Haftar, who serves as deputy commander-in-chief of the eastern Libyan National Army.
Also present were Khalid Haftar, the army's chief of general staff, and Belgasem Haftar, who chairs the Libya Development and Reconstruction Fund.
Earlier in the day, Haftar held separate talks with Fidan, Guler, Kalin, Bayraktaroglu and Energy and Natural Resources Minister Alparslan Bayraktar, according to Turkish diplomatic sources and images shared by the foreign ministry.
Türkiye hosted talks in October between representatives of Haftar's administration and the rival government in Tripoli.
It remains one of the few countries that maintain ties with both camps. Erdogan met Tripoli-based Prime Minister Abdulhamid Dbeibah on Nov. 12 on the sidelines of a climate summit in the southern resort city of Antalya.
In October, Libya's eastern-based parliament approved a contested maritime boundaries agreement signed with Türkiye in 2019.
Haftar's trip came three days after Ukraine's attack on two Russian ships near the eastern city of Benghazi.
On Sunday, the Russian corvette Merkury exploded and sank at the port of Benghazi, and a dry cargo vessel was also hit. Ukraine claimed responsibility and alleged that Russia was transporting weapons.
The incident has raised fears of a deepening crisis in Libya. The Tripoli government has sought clarification from Ukraine, while eastern authorities have called for an international investigation into allegations of a Ukrainian military presence in Libya.
Haftar maintains close ties with Russia. Türkiye has sought to mediate between Moscow and Kyiv since the start of the war in Ukraine.