The Ottoman Empire conquered the coastal areas of Libya during the mid-16th century and had made a great impact on the society of Libya. By then known as Tripolitania under the Ottomans, the province enjoyed a degree of autonomy, though unstable and varied.
In the 18th century, Ahmed Karamanli founded the semi-independence Karamanli dynasty, which ruled Libya and still acknowledged Ottoman control. Under his reign, Libya was one of the most prosperous parts of the empire with strong Libyan [clarification needed], but due to his defiace to the Turks, it drew hostility indirectly from the Ottomans. His successors, however, were not as successful as Ahmed, and the dynasty would immediately collapse in late 18th century, and the Barbary Wars launched by the United States only ensured the complete collapse of Karamanli authority. By then, until the Italian conquest, Ottoman rule in Libya was secured, but it was neglected from the mainland due to its lack of development.
20th century to 2011
With the Kingdom of Libya established, Turkey and Libya maintained cordial relations, with both are commonly Muslim majority nations.
In 1969, a bloodless coup occurred in Libya while King Idris was in Ankara, Turkey for medical treatment. Subsequently, King Idris condemned the coup, but lacked authority to be against it. Eventually, the Libyan King had to live in exile until 1983 when he died in Cairo.
Since the fall of Senussi dynasty, Turco-Libyan relations were driven between cooperations and hostilities. Despite Muammar Gaddafi provided Turkey with spare parts to its US-made aircraft during the Turkish invasion of Cyprus, as a U.S. arms embargo was imposed on Turkey, and preferred buying Turkish stuffs, he had also created controversies, accusing Turkey for the Kurdish question, and provoked Turkey by supporting Kurdish independence. This was reconfirmed in 2011 by Jawad Mella, the President of Kurdish National Congress in exile. Thus, tie between Turkey and Libya was severely damaged until 2011.
While initially just after the NATO operation, Turkey opposed and accused "Sarkozy of pursuing French interests over liberation of Libyan people", on March 20th it took an observant position. Due to Gaddafi's support for Kurdish independence movement, Turkey in 2011 was among the first to immediately cut tie with Libya, demanding Gaddafi to quit the Government and Turkey would offer him in exile. Gaddafi refused to do so and Turkey threw its support to anti-Gaddafi forces, notably National Transitional Council in July 2011.
With the outbreak of the second Libyan Civil War, Turkey remains supportive of the UN-recognized Government of National Accord in Tripoli, against Haftar-based House of Representatives in Tobruk. Haftar's vehement anti-Turkish stance had contributed to ongoing hostility between Turkey and Tobruk Government, as well as Turkey has transported weapons and ammunitions to the government in Tripoli.
Turkey's Vice President, Fuat Oktay, accused indirectly Haftar as the trouble-maker who wanted to prevent peace for Libya and had left the conference for peace in Libya in November 2018. Haftar had remained as belligerent against Turkey, led by Recep Tayyip Erdoğan, and Tobruk-based forces often seized Turkish ships transporting arms to the army in Tripoli.
The failure of the government held in Tripoli could be seen as a political setback of Erdoğan, since Turkey had thrown a great depth of weight and aids to them. Following the 2019 Western Libya offensive led by Haftar, Turkey had shown deep concerns and secretly condemned Haftar for destabilizing Libya. In November 2019, Turkey stated that it signed an agreement with Libya’s internationally recognized government on maritime boundaries in the Mediterranean Sea, in addition to a deal on security and military cooperation.
In 2019, the United Nations reported that Jordan, Turkey and the United Arab Emirates have systematically violated the Libyan arms embargo. Adding that “routinely and sometimes blatantly supplied weapons with little effort to disguise the source”. Also, the Libyan National Army accused the Turkish authorities of supporting terrorist groups in Libya for many years, added that the Turkish support has evolved from just logistic support to a direct interference using military aircraft to transport mercenaries, as well as ships carrying weapons, armored vehicles and ammunition to support terrorism in Libya. However, these accusations were made after pro-Haftar forces lost control over the strategic town of Gharyan after anti-Haftar forces, who back Libya's internationally recognized government, managed to push back pro-Haftar forces. In retaliation for his defeat, Haftar, who is backed by the United Arab Emirates and Egypt, responded by threatening Turkey and vowed to target all Turkish ships and companies, ban flights to and from Turkey, and arrest Turkish nationals in Libya. Other false accusations by Haftar after his loss of Gharyan were refuted by both the GNA and authorities in Gharyan.
On 2 January 2020, Turkey's parliament approved a bill to deploy troops into Libya to back the UN-recognised government in the capital, after forces loyal to Haftar, a rival administration, launched an offensive. The legislation passed with a 325-184 vote, however the details of the deployment have yet to be revealed in terms of amount and timing. On 6 January, Turkish troops began moving into Libya. On 8 January 2020, after talks between presidents Tayyip Erdogan and Vladimir Putin in Istanbul, Turkey and Russia urged all parties in Libya to declare a ceasefire at midnight on 12 January. 
- Akiba, Jun. "Administration of Justice in Ottoman Libya, 1835-1911" – via www.academia.edu. Cite journal requires
- Oyeniyi, Bukola A. (31 March 2019). "The History of Libya". ABC-CLIO – via Google Books.
- "Libya - Karamanlis". countrystudies.us.
- John, Ronald Bruce St (26 March 2013). "Libya and the United States, Two Centuries of Strife". University of Pennsylvania Press – via Google Books.
- "1969: Bloodless coup in Libya". 1 September 1969 – via news.bbc.co.uk.
- Ap (26 May 1983). "King Idris, Ousted in '69 by Qaddafi, Dies in Cairo" – via NYTimes.com.
- "Analysis: Turkey Has Been in Libya Since Gaddafi's Fall". see.news. 1 December 2019.
- Kinzer, Stephen (9 October 1996). "Tirade by Qaddafi Stuns Turkey's Premier" – via NYTimes.com.
- "Jawad Mella says Muammar Gaddafi is the only world leader who truly supports the Kurds". ekurd.net.
- "Turkey says offered Gaddafi "guarantee" to quit Libya". 10 June 2011 – via www.reuters.com.
- "Turkey recognises Libyan rebels". France 24. 3 July 2011.
- "Haftar displeasure over Qatar, Turkey on display at Palermo". english.alarabiya.net.
- "Haftar accuses Turkey of violating arms embargo on Libya - AW staff". AW.
- "Turkey's Vice President Oktay storms out of Libya conference in Italy - Turkey News". Hürriyet Daily News.
- "Turkey raises concern over tension in Libya". yenisafak.com. Yeni Şafak.
- "Turkey and Libya sign deal on maritime zones in the Mediterranean". Reuters. 2019-11-28. Retrieved 2019-11-28.
- "Libya arms embargo being systematically violated by UN states". The Guardian. 9 December 2019. Retrieved 9 December 2019.
- "Libyan National Army: Turkey supports terrorists, directly interferes in Libya". egypttoday. 29 June 2019. Retrieved 29 June 2019.
- "Haftar vows attacks on Turkish assets in Libya". france24. 29 June 2019. Retrieved 29 June 2019.
- "Turkey deploys troops to bolster Libyan government". BBC News. 6 January 2020. Retrieved 6 January 2020.
- "Turkey, Russia call for ceasefire in Libya on Jan 12". Reuters. 2020-01-08. Retrieved 2020-01-08.