In the early 1900’s Libya was still part of Ottoman Empire. On 29 September 1911, Italy declared war against the Ottoman Empire saying they want to protect Italian citizens in Tripolitania and Cyrenaica but their primary aim was to take over Libya. The war lasted till 1912 when Turkey let go of Libya and decided to Sign the treaty of Ouchy (Treaty of Lausanne) and thus Libya became an Italian Colony.
When World War 1 started Italy needed there soldiers so they withdrew majority of them from Libya. A political and religious group called "The Senussi" led by Muhammed Idris made a successful attempt by pushing out the remaining Italian troops out of Libya. They therefore granted Muhammed Idris the Emir title. 
Libya is a country located in North Africa. Bordering the Mediterranean Sea to the north, Libya lies between Egypt to the east, Sudan to the southeast, Chad and Niger to the south, and Algeria and Tunisia to the west. With an area of almost 1.8 million square kilometres (700,000 sq. mi), 90% of which is desert, Libya is the fourth largest country in Africa by area, and the 17th largest in the world. 
In 1912 to 1927, Libya was known as Italian North Africa. It was later divided into Italian Cyrenaica, the Fezzan and Italian Tripolitania in 1927. In 1934, the Italy decided to name it Libya. Libya gained independent under King Idris in 1951 and became the first country to gain independence from colonial rule through the United State. 
Idris ruled as an old-fashioned monarch, with scant regard for any democratic ideals. For the first eight years his realm was similarly backward, an impoverished region in which a subsistence economy got boosted only by revenues from British and US airbases and by international aid.
This situation was transformed in 1959 by the discovery of major oil reserves. Idris with the luxury now of massive national revenue, began to assert Libya's new independence. Negotiations begun in order to secure the withdrawal of foreign troops from Libyan soil. Libya decided to suspend oil exportation to United State which is an attempt to counter the United States’ termination of economic assistance program.  But the king's leisurely pace was suddenly trumped in 1969.
In 1969, King Idris travelled to Turkey for medical treatment and Muammar Gaddafi seizing power from him through a bloodless military coup d’état. 
Muammar Gaddafi: Background/History
Muammar Gaddafi was born in 1942 in Sirte, western Libya. He was born into a tribal family called al-Qadhafi. As at the time of his birth, Libya was an Italian colony. Libya became independent in 1951 under western-allied King Idris. Gaddafi was influenced by the Arab nationalist movement and so much admired Egyptian President Gamal Abdel Nasser. Gaddafi enrolled in military college in the city of Benghazi in 1961, he also spent four months in military training in United Kingdom. After his graduation, his steady rose through the military ranks and became dissatisfied with the rule of the then Libya leader King Idris. 
Commissioned into the Libyan army in 1965, he began laying groundwork for an overthrow of the Libyan monarch, King Idris, whom he considered a pawn of the Western European nations. Qaddafi became involved with movement of young officers to overthrow the king.
In August 1969, King Idris travelled to Turkey for medical treatment and on September 1969, Gaddafi’s led group took opportunity of king Idris’ absence by staging a bloodless Coup d’état. This movement was said to aim at putting an end to the monarchy in Libya. 
Once Qaddafi became the leader, he closed down the American and Britain military base in Libya, he also expelled the few Jews that remained in Libya for the 1967 war, he nationalized all foreign banks and oil companies and renamed the Country "The Libyan Arab republic". 
Gaddafi might not have been the best leader, he might have political issues but he had done some good works for his country. Under Gaddafi’s administration Libya was 53 on the United Nations Human development index rank. Gaddafi declared free education for all which include the fees of all those studding abroad. With the aim of encouraging farming and boast agricultural products, Gaddafi imposed no tax on agricultural products.
Because the Islamic practice frowns at vigorous, non interest loan were granted to citizen so that they can build on their personal businesses, the unemployed were paid unemployment fee and he provided basic social amenities like water, electricity, shelter, for Libyans at a subsidence rate.
Despite his weaknesses, Gaddafi also took his innovative ideas to Africa by suggesting the creation of a United State of Africa, he said "We want an African military to defend Africa, we want a single currency, and we want one African passport" 
On the other hand, his regime was also characterised to have promoted various terrorist regime and groups including Iran, Syria, Uganda, and Irish Republican Army among other. With the support of the Soviet Union he fought and unsuccessful battle against Egypt and Syria. His regime provoked many incidence with the united State which led to the American bombing of Tripoli (Libya’s Headquarters) on April 15, 1986.
In 1988, Gaddafi killed over 200 people through his bomb attack on Pan Am Flight 103 over Lockerbie, Scotland. 
"After the September 11, 2001, terrorist attacks on the US, Gaddafi worked to improve his relationship with the West. In exchange for his help in tracking down Islamic militants his government received concessions from the West, including the easing of various restrictions placed against it due to his terrorism of the 1980s." 
Understanding Arab Spring
Arab spring is a phenomenon that engendered waves of revolution and clamour for democracy in the Arab world. It began peacefully with non-violent resolution in Tunisia followed by Egypt and later spread through Middle East and North Africa. The early movement in Tunisia and Egypt resulted into the collapse of regime in both countries and creation of new. This 2011 uprisings triggered a wide set of social movements and regime change across Middle East and North Africa.
Situation in Tunisia and Egypt
The Tunisian uprisings were triggered by the suicide of Mohamed Bouazizi, an unemployed street vendor, on December 17, 2010. The uprisings that followed escalated throughout the following months. January 14, 2011 saw 8000 people demonstrating outside the ministry of the Interior in Tunis. This led to President Zine Al-Abidine Ben Ali announcing the withdrawal of the government. He also declared that new elections would be held within six months.
Also, a curfew and a state of emergency were introduced. Ben Ali, who had been in power since a non-violent coup d’etat in 1987, left the country the same day.  The leader of the Parliament, FouedMebazaa, was appointed as interim president. Initially, several representatives from Ben Ali’s government were given positions in the new government. However, they had to leave office after a series of protests. Significant reforms were introduced and today freedom of speech, press and assembly is practiced.  Parliamentary elections should have been held on July 24th 2011. However, they were postponed to October 23, 2011. These elections were followed by reports of high turnout, and reportedly, the elections were free and fair. 
In 1981, Hosni Mubarak came to power, a power he held until his exit from the political scene on February 11, 2011. Mubarak became president after the assassination of his predecessor Anwar Sadat. Throughout all the presidential elections until 2005, Mubarak had no real opposing candidates. 2005, however, marked the first presidential elections since Mubarak came to power in which more parties were able to nominate a candidate. However, the 2005 election was also met with sharp criticism for the election not being free and fair enough. 
During the entire Mubarak presidency, there has been a state of emergency in Egypt. The Arab Spring protests in Egypt commenced in January 2011. On the day later known as the "Day of rage", January 25th, 15 000 people gathered in Cairo, protesting against Mubarak’s regime. At the same time demonstrations took place in several Egyptian cities. This was followed by massive protests after the Friday prayer on February 28. The demonstrations continued, demanding new elections, an end to the state of emergency, and more jobs. Up to Mubarak’s retirement on February 11, 2011, more than 846 people were killed, and 6000 wounded, in the protests. In August the state of emergency was lifted. 
The trial against Mubarak started in August 2011. He was prosecuted along with his sons Alaa and Gamal, previous interior minister Habib al-Adly and six heads of security. They were accused for ordering the killings of more than 800 people during the uprising in January and February. They were also accused for having stolen considerable sums from the Egyptian Treasury. 
The first round of parliamentary elections was held on November 28th 2011. These elections were marked by strong protests before and after the election date. However, the second round of elections in mid-December was relatively peaceful. 
Notably, that the young Egyptians were inspired by the act of the Tunisian street vendor Mohamed Bauazizi, who set himself on fire on 17 December 2010 in protest at inequality and high unemployment.
Effect of Arab spring on Libya and the intervention of International Organizations
Unlike Tunisia and Egypt, who experienced relatively peaceful uprisings as they forced the respective Presidents out of office, Libya experienced a bloody civil war between Muammar Gaddafi’s loyalists and rebels from across the country.
The Arab Spring reached Libya on 16 February 2011 with protests for democracy hitting the streets. Many of the protestors were killed by the Gaddafi regime. One week later the National Transitional Council (NTC) was formed by what became the Libyan rebels. The rebels began an armed opposition against the Gaddafi regime aided by NATO air forces. During the fighting the International Criminal Court (ICC) released warrants for the arrest of Gaddafi and certain cabinet members. The rebels struggled against the regime until August 21st, when the rebels entered Tripoli. 
The conflict and intervention in Libya was distinct from other uprisings elsewhere in the region for three principal reasons: firstly, the brutality with which Colonel Muammar Gaddafi’s regime responded; secondly, the audacity, tenacity and speed with which the Libyan people became militarily organized and capable of exploiting Gaddafi’s disintegrating military; and thirdly, the involvement of the international community, in the form of the NATO alliance that was backed up by Arab support, particularly from the Gulf state of Qatar. 
The armed uprising against the four-decade rule of Gaddafi and increased violence by his government to suppress the rebels led to civil war, international condemnation, and military intervention backed by the UN Security Council. On 26th February 2011, the UN Security Council adopted resolution 1970, imposing economic sanctions, travel bans, and an arms embargo; freezing Gaddafi’s assets, and those of certain other government officials; and referring the acts of violence by Gaddafi’s regime to the International Criminal Court (ICC). 
The Council obligated all UN member states to freeze without delay all funds, financial assets, and economic resources, which are on their territories and which are owned or controlled, directly or indirectly, by the individuals or entities listed in the resolution. 
On 17th March 2011, the UN Security Council passed resolution 1973 with 10-0 vote and five abstentions. The Resolution sanctioned the establishment of a no-fly zone, and authorized Member States, acting either alone or through regional organizations or arrangements, "to take all necessary measures to protect civilians under threat of attack in the country, including Benghazi." 
According to the Security Council, states which voted for the resolution agreed that the strong action was necessary "solely to protect civilians from further harm" because the Gaddafi regime was about to unleash more violence on the civilians in the opposition strongholds in the Eastern part of the country 
Two days later, a coalition of states including the United States, the United Kingdom, and France began to carry out air strikes against military targets in Libya. By the end of March 2011, NATO had taken over the international military operation in Libya. 
Regime change has usually been initiated and carried out by single states and coalitions of states outside of the international institutional framework and without authorization by the United Nations Security Council. 
We should note that Chapter VII of the UN Charter through Articles 39, 41 and 42 enable the Security Council to authorize military enforcement action to maintain or restore peace and security, only in cases where it finds a threat to international peace and security 
"However, NATO’s unrivalled military capabilities provide operations with ‘muscle and teeth’. Coordination and combination of NATO and UN resources allows for new Synergies. In case of Libya, NATO members already had interest in cooperating with UN to receive a Security Council mandate for the use of force. Yet ones the allied ‘stand-alone’ intervention had begun, the UN became dependent on NATO to influence the conduct of military operations". 
"Gaddafi was killed outside of Sirte on 20 October after an American Predator and a French warplane stopped his convoy during his escape. According to reports, the NATO attack destroyed two vehicles, neither of which held the dictator. However, the vehicles were forced to scatter, and when rebels came to the scene, Gaddafi was beaten and killed by opposition fighters."