Libya–Spain relations
Libya–Spain relations are the bilateral and diplomatic relations between these two countries. Libya has an embassy in Madrid, and Spain has one in Tripoli. Diplomatic relations. First contacts between the Kingdom of Libya and Francoist Spain after the 1951 Libyan independence began to develop after King Idris paid a visit to Spain in 1953. By means of the exchange of ambassadors, Spain and Libya established full diplomatic relations on 14 January 1961. Cooperation in the energy sector ensued. Following the 1969 coup d'etat in Libya and the ascension of Muammar Gaddafi to power, a pragmatic Spain  had no problem to continue with the ongoing relations, in the overarching frame of Spanish neutrality towards the struggle between Conservative Arab monarchies and Pan-Arabist rulers taking place within the Arab League, although it did not take long for disagreements to emerge between the two countries over the timetable for the Spanish decolonisation of Western Sahara, and Libya eventually came to provide financial funding to the Polisario Front after 1973. Nonetheless, a 1972 visit to Libya by Spanish Foreign Minister Gregorio López Bravo consolidated existing relations, confirming Libya as a leading energy provider, a circumstance that eventually proved to  be a major coup for the Spanish diplomacy in the context of the oil embargo by Arab countries (and ensuing energy crisis) on many Western countries on the wake of Israeli victory in the Yom Kippur War in 1973. Relations were strained in the 1980s, and there were various Libyan interference attempts in Spanish domestic politics, by providing logistic support to a number of political groups. Gadaffi had expected the new PSOE government to remove Spain from NATO membership after it came to power in 1982 and, shortly afterwards the 1986 referendum on the matter, he threatened Spain and Italy  with military retaliation in case Libya was attacked. In 2004 a timid normalization of Libya's relations with the international community began. In 2011 Spain was one of the first countries to position itself in favor of the 17 February revolution, actively supporting it in the political and humanitarian assistance fields. In the political arena, Spain recognized in March 2011 the Transitional National Council, provisional government, and a month later moved a special envoy to Benghazi; he was a member of the "Group of friends of Libya" and participated in the operation of NATO in defense of the Libyan people . The Minister of Foreign Affairs and Cooperation, Trinidad Jiménez, traveled to Benghazi in June 2011, when military conflict had not yet come to an end. After the beginning of the political transition in Libya, Spain has sought to relaunch bilateral relations by showing its willingness to accompany Libya in the democratization process. With this objective, the Minister of Foreign Affairs and Cooperation José Manuel García-Margallo, accompanied by the Minister of Development Ana Pastor, visited Tripoli on 16 and 17 December 2012 to convey a message of support from the Spanish government to the new Libyan authorities, and to boost  economic and business relations between the countries. After 2014, the Spanish diplomatic mission to Libya operated from Tunisia. On 3 June 2021, on the wake of his official visit to Libya to endorse the process for political transition and reconstruction in the country, Spanish Prime Minister Pedro Sánchez met with provisional Prime Minister Abdul Hamid Dbeibeh (GNU) and presided over the re-opening of the embassy in Tripoli (which would facilitate the issuance of Schengen visas to Libyan citizens). Cooperation. Spain was the fifth European donor in humanitarian aid during the Libyan revolution of 2011, contributing more than 7 million  euros. The process of political and social changes in Libya and other countries in the wake of the Arab Spring in January–February 2011 has led to a reformulation of the development cooperation policy in the region focusing on the accompaniment of the processes of democratic change. The Masar Program is a Spanish Cooperation program initiated in June 2012, whose purpose is to accompany democratic governance processes in the Arab World, contributing to the modernization and strengthening of institutions and of the key actors in the development of the rule of law, so that public authorities can respond to the  needs of their societies, and civil society can be one of the engines of change. The strategic objective of Spanish cooperation in Libya is to contribute to strengthening the country's capacities in its process of reconstruction and political transition. In 2012, Spain financed a demining program of the MAG NGO and the electoral assistance program of the United Nations Mission in Libya. Within the framework of the Masar program, Libya's Deputy Minister of Justice of Libya, Sahar Banoon, traveled to Spain on 17 June 2013 together with a delegation from his ministry to learn about the Spanish prison  system with a view to starting collaboration on prison reform in Libya. The promotion of exchanges at the institutional, business and civil society level between Spain and Libya is one of the main aspects of Spanish cooperation through study visits to Spanish institutions and participation in conferences and seminars organized by institutions such as Casa Árabe, Casa Mediterráneo, and Club de Madrid. In the cultural field, the promotion of Spanish culture and language stands out, with the creation of a Spanish reading place at the University of Tripoli in the 2013–2014 academic year.