In May 1998, an agreement was reached between the United States and the European Union, under which sanctions against European companies wishing to trade with the country were suspended. In the following July the representatives of Libya and Italy signed a joint document that put an end to the long dispute concerning the Italian colonial occupation and the expulsion of several thousand Italians from the country in 1970. The first sign of detente was the trip of the Minister of Foreign Lamberto Dini in Tripoli in April 1999. In the following May Libya handed over to the UN the alleged perpetrators of the Pan Am Boeing bombing in the sky over Lockerbie, Scotland. The international sanctions imposed by the UN in 1992 were thus immediately suspended (although President Clinton decided to maintain the American embargo). In the following June, diplomatic contacts between Libya and the US reopened at the United Nations headquarters in New York, frozen since 1979.
In 2003, according to remzfamily, the UN Security Council definitively canceled the sanctions imposed in 1992, after Libya reached an agreement with Great Britain and France for compensation to the relatives of the victims of the Lockerbie and Niger desert attacks, the latter against a French company in 1989. At the end of the same year, moreover, Libya undertook with Great Britain and the United States to sign the Treaty on the Non-Proliferation of Weapons of Extermination and to allow inspections by the International Atomic Energy Agency. To crown this path, in June of the following year Libya definitively re-established diplomatic relations with the United States, which in September lifted the embargo. In the wake of the detente path undertaken by Italy and Libya in August 2008, the two countries signed a cooperation agreement which also includes the recognition of the damage inflicted on the North African country during the colonial period. In February 2011, following the popular demonstrations in the Middle East, the opposition to the government demanded a profound democratic change. In the following days, violent clashes took place, especially in the eastern part of the country, and a transitional political council was formed in the city of Benghazi, fallen into the hands of the rioters. The government forces that controlled the capital and central areas of the country launched a military counter-offensive condemned by the international community.
The oil companies almost completely suspended their business. In March, on the proposal of the USA, France and England, the UN Security Council issued two resolutions (n ° 1970 and 1973) which imposed sanctions, a ceasefire and a ban on all flights into Libyan territory. (no fly zone). Thus, a coalition of military forces was created, first under US command and then under NATO command, which intervened in favor of the anti-government troops. At the end of August, after fierce fighting, the anti-government forces entered Tripoli and overthrew the regime, while Gaddafi managed to escape, until October when during a firefight between loyalists and anti-government troops, he was wounded and, later, executed on the spot. Former justice minister Mustafa Abd al-Jalil was called to lead the provisional government. The Alliance of New Forces (AFN), a secular and liberal coalition close to Prime Minister al-Jalil, won the legislative elections, winning 39 of the 80 seats in the new assembly.
In September 2012, the return to normal was interrupted by a terrorist attack on the US diplomatic office in Benghazi. In the summer of 2014, extremist militias from Misrata conquered the Tripoli airport despite the intervention of air forces that had bombed the area. The latter were probably composed of aircraft from the United Arab Emirates which departed from bases in Egyptian territory. The intervention (officially denied by Egypt and not confirmed by the UAE) configured a confrontation that is now wider than the borders of the Libyan state, pitting states against fundamentalist groups such as Egypt, the United Arab Emirates and Saudi Arabia, and supporters such as Qatar. The militiamen who attacked the capital resettled the General National Congress which elected a new prime minister. The elections of June 2014 awarded the victory to the liberals and in September the premier al-Thani obtained the confidence of the Parliament gathered in Tobruk for greater security. The parliament, although recognized by the international community, it was judged unconstitutional by the Supreme Court and the Islamist forces reorganized and elected their own premier in the person of O. al-Hassi. Meanwhile, in some areas of the country, especially in Derna and Sirte, cells of the self-styled were taking root Islamic State (IS) arousing the concern of the international community which decided to intervene in an attempt at mediation between the parties. In January 2016, thanks to the mediation of the United Nations, a government of national unity based in Tripoli and led by Prime Minister al-Serraj (in office since 2015) was formed. However, the Tobruk parliament, headed by K. Haftar, refused to give its trust to the al-Serraj government and in August 2016 61 members of the Tobruck parliament declared their opposition to the al-Serraj government, which also enjoyed of the support of the United Nations. In July 2017 Haftar and al-Serraj agreed in Paris to establish a truce in the conflict and call new elections.