Libya, formally the State of Libya, is a nation in the Maghreb area of North Africa that borders the Mediterranean Sea. In addition to the Mediterranean Sea to the north, Egypt to the east, Sudan to the southeast, Chad to the south, Niger to the southwest, Algeria to the west, and Tunisia to the northwest are all borders that the country has with other countries. In the eastern Mediterranean, it has maritime boundaries with Malta, Greece, and Turkey, among other countries. Libya is divided into three historical areas: Tripolitania, Fezzan, and Cyrenaica. Tripolitania is the largest of the three historical divisions. This nation, which has an area of almost 700,000 square miles (1.8 million km2), is the fourth-largest country in both Africa and the Arab world, and it is the 16th-largest country in the world. Libya has the tenth-largest proven oil reserves in the world, according to the International Energy Agency. Tripoli, Libya's main city and capital, is situated in western Libya and is home to more than three million of the country's seven million inhabitants.
Libya has been inhabited by Berbers since the late Bronze Age, when they arrived as ancestors of the Iberomaurusian and Capsian civilizations, which settled there. It was the Phoenicians who built city-states and commercial centres in western Libya thousands of years ago. Parts of Libya were governed by Carthaginians, Persians, Egyptians, and Macedonians at different times throughout history, and eventually the whole modern-day nation became a member of the Roman Empire. Libya was an early Christian hub with a population of over a million people. Immediately after the disintegration of the Western Roman Empire, the territory of Libya was dominated by the Vandals until the arrival of Islam in the 7th century, when invasions introduced the religion to the region. The Spanish Empire and the Knights of St John seized Tripoli throughout the 16th century, and the city remained under their control until the arrival of the Ottomans in 1551. Libya was a participant in the Barbary Wars that raged in the 18th and 19th centuries. Italian annexation of Libya and the formation of two colonies, Italian Tripolitania and Italian Cyrenaica (1911–1934), which were subsequently combined into the Italian Libya colony from 1934 to 1947, followed by the end of Ottoman control in the wake of the Italo-Turkish War in 1915.
While fighting in the North African Campaign of the Second World War, Libya was a theatre of operations. Following then, the Italian population began to dwindle. It was in 1951 as Libya achieved independence as a kingdom. In 1969, a bloodless military revolution headed by Colonel Muammar Gaddafi ousted King Idris I of Libya and established a republic, ending the reign of the monarchy. Gaddafi was often referred to be a dictator by his detractors, and he was one of the world's longest-serving non-royal leaders, having ruled for 42 years. He governed until he was ousted and assassinated during the Libyan Civil War in 2011, after which the power was given to the General National Congress of the country. As early as 2014, two competing governments claimed to administer Libya, destabilising the nation and sparking a second civil war, with portions of the country divided between the Tobruk and Tripoli-based administrations, along with a variety of tribal and Islamist militias. After signing a lasting truce on October 23, 2020, the two major warring parties recognised the authority of a unity government.
Libya is a member of the United Nations, the Non-Aligned Movement, the African Union, the Arab League, the Organization of Islamic Cooperation, and the Organization of Petroleum Exporting Countries. Despite being an Islamic state, the majority of the country's population is Sunni Muslim, accounting for 96.6 percent of the population.