Throughout most of its history the territory that constitutes modern Libya has been held by foreign powers. Tripolitania and Cyrenaica had divergent histories for most of the period up to their conquest by the Ottoman Empire in the mid-16th cent. Fazzan was captured by the Ottomans only in 1842. The Ottomans gained control of most of N Africa in the 16th cent., dividing it into three regencies—Algeria, Tunisia, and Tripoli (which also included Cyrenaica). The Janissaries, professional soldiers of slave origins, became a military caste, wielding considerable influence over the Ottoman governor. From the early 1600s the Janissaries chose a leader, called the dey, who at times had as much power as the Ottoman governor sent from Constantinople. Numerous pirates who preyed on the shipping of Christian nations in the Mediterranean were based at Tripoli's ports.
In 1711 Ahmad Karamanli, a Janissary, became dey, killed the Ottoman governor, and prevailed upon the Ottomans to name him governor. The post of governor remained hereditary in the Karamanli family until 1835. In the 18th cent. and during the Napoleonic Wars, the dey took in great revenues from the pirates and also extended the central government's control to much of the interior.
During 1801–5 the United States and Tripoli fought a war precipitated by disagreements over the amount of tribute to be paid to the dey in order to gain immunity from raids by pirates (see Tripolitan War). After 1815, England, France, and the kingdom of the Two Sicilies undertook a successful campaign against the pirates, which undermined the finances of the dey and thus facilitated the reestablishment of direct Ottoman rule in Tripoli in 1835. During the rest of the 19th cent., the Ottomans contributed little toward the political stability or the economic development of Tripoli. Beginning in the 1840s the Sanusi brotherhood gained many adherents, primarily in Cyrenaica but also in S Tripolitania and Fazzan.
During the Turko-Italian War of 1911–12, Italy conquered N Tripoli, but by the Treaty of Ouchy, which ended the war, Turkey granted Tripoli and N Libya autonomy. The Libyans continued to fight the Italians, but by 1914 Italy had occupied much of the country. However, Italy was forced to undertake a long series of wars of pacification against the Sanusi and their allies.
Under Italo Balbo, who was governor-general during the 1930s, the country's infrastucture was developed as roads, civic buildings, schools, and hospitals were constructed. In 1934, Tripolitania and Cyrenaica were formally united to form the colony of Libya; Fazzan was administered as part of Tripolitania. About 40,000 colonists were sent from Italy to the plateau regions of Libya at the end of the 1930s. Libya was made an integral part of Italy in 1939, and the Muslim population was granted a limited form of citizenship.
Libya became one of the main battlegrounds of North Africa after Italy entered World War II in June, 1940 (for military details, see North Africa, campaigns in). After the Allied victory over the Axis in N Africa (1943), Libya was placed under an Anglo-French military government. The Big Four (Great Britain, France, the United States, and the USSR) failed to reach agreement on the future of Libya as stipulated in the 1947 peace treaty with Italy. The United Nations was given (1949) jurisdiction and decided that Libya should become independent, which it did on Dec. 24, 1951, as the United Kingdom of Libya. It was ruled by King Idris I, head of the Sanusi brotherhood. Libya joined the Arab League, and in 1955 it was admitted into the United Nations.
The 1950s in Libya were characterized by great poverty; minimal economic development was made possible only by the payments and loans received from various Western nations. In 1958, petroleum was discovered in the country, and by the early 1960s Libya was taking in growing revenues from the exploitation of that resource. A 1953 Anglo-Libyan treaty that had allowed Britain to establish military bases in Libya in return for economic subsidies was terminated by Libya in 1964; most British troops were withdrawn in early 1966.
In Sept., 1969, a group of army officers led by 27-year-old Col. Muammar al-Qaddafi ousted King Idris in a coup. The 1951 constitution was abrogated, and government was placed in the hands of a 12-member Revolutionary Command Council (RCC) headed by Qaddafi, who became prime minister. In mid-1972, Qaddafi turned the post of prime minister over to Abdul Salam Jallud, but he remained the RCC's president, the country's most important political and military office.
The regime pursued a policy of Arab nationalism and strict adherence to Islamic law; though Qaddafi espoused socialist principles, he was strongly anti-Communist. He was particularly concerned with reducing Western influences; the British were forced (1970) to evacuate their remaining bases in Libya, and the United States was required to abandon Wheelus Field, a U.S. air force base located near Tripoli. Libya's foreign policy was generally reoriented away from N Africa and toward the heart of the Middle East. Close ties were established with Egypt, and in 1971 Libya joined with Egypt and Syria to form a loose alliance called the Federation of Arab Republics. A "cultural revolution" launched in 1973 sought to make life in the country more closely approximate Qaddafi's socialist and Muslim principles.
An implacable foe of Israel, Libya contributed some men and matériel (especially aircraft) to the Arab side in the Arab-Israeli war of Oct., 1973. After the war, Libya was a strong advocate of reducing sales of petroleum to nations that had supported Israel and was also a leading force in increasing the price of crude petroleum. Qaddafi was severely critical of Egypt for negotiating a cease-fire with Israel, and relations between the two countries declined steadily after 1973 when Qaddafi failed to push through a merger with Egypt.
Qaddafi survived numerous coup attempts and abortive uprisings through the 1990s; in 1980 he began ordering the assassination of Libyan dissidents who were living in exile in Europe. In 1981, two Libyan fighter planes attacked U.S. forces on maneuvers in the Gulf of Sidra (which Libya claims as national waters) and were shot down. Libya's relations with the United States became even more hostile when it began to support international terrorist organizations. The United States placed a ban on Libyan oil imports in 1982. In 1986, in an apparent attempt to kill Qaddafi, U.S. President Reagan ordered air strikes against Tripoli and Benghazi in retaliation for the Libyan-sponsored terrorist attack in West Berlin that had killed two American servicemen. Libya's attempts in the mid-1980s to form a union with Algeria and Tunisia, while not successful, resulted (1989) in the Arab Maghreb Union (see Maghreb).
In 1988, a bomb blew up on a Pan Am commercial airplane over Lockerbie, Scotland, killing 270 people. International warrants were issued for the arrest and extradition to Great Britain of two Libyan suspects in the case, but the government refused to surrender them. Libya was also implicated in the similar 1989 bombing of a French UTA DC-10 over Niger in which 170 people died. In 1989, it was discovered that a West German company was selling Libya equipment for the construction of a chemical weapons plant at Rabta. These actions, as well as the widespread belief in the United States and Europe that Qaddafi's regime was responsible for terrorist activities, led to American and UN sanctions against Libya in 1992. Libya pulled its troops out of the Aozou Strip, a mineral-rich region of N Chad, in 1994 after the World Court rejected its claim to that territory. In 1995 there were clashes between Libyan security forces and members of Islamic groups in E Libya. The United States charged (1996) that Libya was constructing a chemical weapons plant southeast of Tripoli and said Libya would be prevented from putting it into operation.
Beginning in the late 1990s Libya embarked on a series of moves designed to end its estrangement from Western nations. In Apr., 1999, Libya handed over the suspects in the Lockerbie crash to the United Nations; they were to be tried in the Netherlands under Scottish law. The UN sanctions were suspended, but those imposed by the United States remained in place. In Dec., 1999, Qaddafi pledged not to aid or protect terrorists. Libya agreed in 2003 to a $2.7 billion settlement with the families of the victims. and that and a revised settlement for viction of the UTA bombing led the UN Security Council to lift the sanctions imposed more than a decade earlier. In December, after negotiations with the United States and Great Britain, the government renounced the production and use of chemical, biological, and nuclear weapons and agreed to submit to unannounced international inspections. Subsequently (Mar., 2004), Libya acknowledged that it had produced and had stockpiles of chemical weapons. As a result of these events, the United States lifted most sanctions and resumed diplomatic relations with Libya, although it continued to list Libya as a state sponsor of terrorism until mid-2006. The last of three payments due under the 2003 agreement, however, was not made until late 2008. In Sept., 2008, Italy and Libya signed a memorandum under which Italy agreed to pay $5 billion over 20 years as compensation for its three decades of colonial rule in Libya.
In Feb., 2011, antigovernment protests in Libya quickly became a full-scale uprising, as the government lost control of Benghazi and NE Libya as well as a number of cities in NW Libya. By the end of the month, however, the government had brutally suppressed protesters in the capital, and in early March it recaptured many cities it had lost to the rebellion. Hundreds of thousands of foreigners fled the country. The International Criminal Court issued arrest warrants in June for Qaddafi and other government members in connection with the killing of protesters.
As Qaddafi's forces advanced on Benghazi, the UN Security Council approved (March) a no-fly zone over Libya; it was enforced by aircraft from a mix of NATO and Arab nations, which at times also attacked government ground forces. The Benghazi-based rebels, who established a governing council, fought a seesawing contest for central N Libya. Misratah and the Nafusa Mtns. became the most signifcant battlegrounds in the west, and after repulsing government forces there, the rebels made some advances by midyear. The rebels benefited from aid from some Western and other nations, and their National Transitional Council (NTC) was recognized by some nations. In August, increasing rebel successes culminated in the fall of Tripoli; in September, the NTC was recognized by the United Nations as Libya's legitimate government.
Rebel forces captured Sirte and Bani Walid, two remaining Qaddafi strongholds, in Oct., 2011; Qaddafi was killed while trying to flee Sirte. At the end of the month, Abdurrahim el-Keib was appointed prime minister by the NTC, and a new cabinet was named in November. The situation remained unsettled, however, with occasional fighting erupting between rival militias and tribes, and in Feb., 2012, leaders in E Libya called for the establishment of the autonomous region of Cyrenaica there, a move that was denounced in W Libya.
In July, the 200-members of the national congress were elected, with no group clearly dominating the result. In September, Mustafa Abu Shagur, who had served as a deputy to el-Keib, was chosen as prime minister, but he proved unable to form an acceptable government. Ali Zidan, a former diplomat and exile, was chosen to replace him in October, and formed a government. Also in September the U.S. ambassador was killed in an attack by Islamic militants on the Benghazi embassy. The attack led to a crackdown on Libyan militias, but they remained a significant force and problem in the country, and in subsequent months were a factor in a number of deadly clashes. In Jan., 2013, the president of the national congress survived an attempted assassination.
The congress in May passed a law banning senior officials in the Qaddafi regime from the government; its enactment was forced by armed groups that surrounded government offices. In December the congress voted to make Islamic law the basis of Libyan law, and also voted to extend its mandate by a year, adopting a plan that called for a new constitution to be drafted by Aug., 2014, and a parliament to be elected by Dec., 2014. Meanwhile, groups favoring a federal state sought to establish a government in Cyrenaica and seize control of the region's oil resources; Berbers also interrupted oil and gas shipments in an attempt to win political recognition. Such political, and significant religious, regional, and tribal, divisions have thwarted the establishment of a unified national government, and stoked violence and insecurity.