The earliest known settlements in Lebanon date back to earlier than 5000 BC. Archaeologists have discovered in Byblos, which is considered to be the oldest continuously-inhabited city in the world, remnants of prehistoric huts with crushed limestone floors, primitive weapons, and burial jars which are evidence of the Neolithic and Chalcolithic fishing communities who lived on the shore of the Mediterranean Sea over 7,000 years ago. 
Lebanon was the homeland of the Phoenicians, a seafaring people that spread across the Mediterranean before the rise of Cyrus the Great. After two centuries of Persian rule, Macedonian ruler Alexander the Great attacked and burned Tyre, the most prominent Phoenician city. Throughout the subsequent centuries leading up to recent times, the country became part of numerous succeeding empires, among them Persian, Assyrian, Macedonian, Roman, Byzantine, Arab, Crusader, and Ottoman.
French mandate and independence
Lebanon was part of the Ottoman Empire for over 400 years, in a region known as Greater Syria, until 1918 when the area became a part of the French Mandate of Syria following World War I. On September 1, 1920, France formed the State of Greater Lebanon as one of several ethnic enclaves within Syria. Lebanon was a largely Christian (mainly Maronite) enclave but also included areas containing many Muslims and Druzes. On September 1, 1926, France formed the Lebanese Republic. The Republic was afterward a separate entity from Syria but still administered under the French Mandate of Syria. Lebanon gained independence in 1943, while France was occupied by Germany. General Henri Dentz, the Vichy High Commissioner for Syria and Lebanon, played a major role in the independence of the nation. The Vichy authorities in 1941 allowed Germany to move aircraft and supplies through Syria to Iraq where they were used against British forces. The United Kingdom, fearing that Nazi Germany would gain full control of Lebanon and Syria by pressure on the weak Vichy government, sent its army into Syria and Lebanon.
After the fighting ended in Lebanon, General Charles de Gaulle visited the area. Under various political pressures from both inside and outside Lebanon, de Gaulle decided to recognize the independence of Lebanon. On November 26, 1941 General Georges Catroux announced that Lebanon would become independent under the authority of the Free French government. Elections were held in 1943 and on November 8, 1943 the new Lebanese government unilaterally abolished the mandate. The French reacted by throwing the new government into prison. In the face of international pressure, the French released the government officials on November 22, 1943 and accepted the independence of Lebanon.
The allies kept the region under control until the end of World War II. The last French troops withdrew in 1946. Lebanon’s unwritten National Pact of 1943 required that its president be Christian and its prime minister be Muslim.
Lebanon’s history since independence has been marked by alternating periods of political stability and turmoil (including a civil conflict in 1958) interspersed with prosperity built on Beirut’s position as a regional center for finance and trade.
1948 Arab-Israeli war
Five years after gaining independence, Lebanon reluctantly joined the Arab League but never invaded Israel during the 1948 Arab-Israeli War. It took over logistical support of the Arab Liberation Army after it found itself cut off from its bases in Syria while going on an attack on the newly-proclaimed Jewish State. After the defeat of the Arab Liberation Army in Operation Hiram, Lebanon accepted an armistice with Israel on March 23, 1949. Approximately 100,000 Palestinian refugees were living in Lebanon in 1949 as a result of the creation of Israel and the subsequent war. The Lebanese-Israeli border remained closed, but quiet, until after the Six Day War in 1967.
Civil war and beyond
In 1975, civil war broke out in Lebanon. The Lebanese Civil War lasted fifteen years, devastating the country’s economy, and resulting in the massive loss of human life and property. It is estimated that 150,000 people were killed and another 200,000 maimed. The war ended in 1990 with the signing of the Taif Agreement and parts of Lebanon were left in ruins.
During the civil war, the Palestine Liberation Organization used Lebanon to launch attacks against Israel. Lebanon was twice invaded and occupied by the Israel Defense Forces (IDF) in 1978 and 1982, the PLO expelled in the second invasion. Israel remained in control of Southern Lebanon until 2000, when there was a general decision, led by Israeli Prime Minister Ehud Barak, to withdraw due to continuous guerrilla attacks executed by Hezbollah militants and a belief that Hezbollah activity would diminish and dissolve without the Israeli presence. The UN determined that the withdrawal of Israeli troops beyond the blue line was in accordance with UN Security Council Resolution 425, although a border region called the Shebaa Farms is still disputed. Hezbollah declared that it would not stop its operations against Israel until this area was liberated.
On February 14, 2005, former Prime Minister Rafik Hariri was assassinated in a car bomb explosion near the Saint George Bay in Beirut. Leaders of the March 14 Alliance accused Syria of the attack due to its extensive military and intelligence presence in Lebanon, and the public rift between Hariri and Damascus over the Syrian-backed constitutional amendment extending pro-Syrian President Lahoud’s term in office. Others, namely the March 8 Alliance and Syrian officials, claimed that the assassination may have been executed by the Israeli Mossad in an attempt to destabilize the country.
This incident triggered a series of demonstrations, known as Cedar Revolution, that demanded the withdrawal of Syrian troops from Lebanon and the establishment of an international commission to investigate the assassination. The United Nations Security Council unanimously adopted Resolution 1595 on April 7, 2005, which called for an investigation into the assassination of Rafik Hariri. The findings of the investigation were officially published on October 20, 2005 in the Mehlis report. Eventually, and under pressure from the international community, Syria began withdrawing its 15,000-strong army troops from Lebanon. By April 26, 2005, all uniformed Syrian soldiers had already crossed the border back to Syria. The Hariri assassination marked the beginning of a series of assassination attempts that led to the loss of many prominent Lebanese figures.
On July 12, 2006, Hezbollah kidnapped two Israeli soldiers and that led to a conflict, known in Lebanon as July War, that lasted until a United Nations-brokered ceasefire went into effect on 14 August 2006.