When Israel was bombing Beirut during the war of 2006, a colleague and I sat drinking a beer after a long, hard day, listening to the explosions coming every few minutes from the southern suburbs. "Is this what it felt like to be somewhere in central Europe in the 1930s?" he mused. Comparisons are never exact, but I saw what he meant. Lebanon, and the region, was dogged not just by the violence of that year's war but also by a gnawing feeling that the future could contain something even worse.
In Lebanon, one of the strongest counterweights to the predictions of bad times ahead is the memory of bad times in the past. Fifteen years of civil war in the 70s and 80s left many scars. Lebanon has managed to survive a succession of serious crises since the assassination – by Syria, bereaved supporters say – of the former prime minister, Rafik Hariri, in 2005. A year later there was a war with Israel; in 2007 a protracted battle with jihadists in a Palestinian refugee camp; and there was a mini-civil war in 2008. The list goes on.
For every Lebanese person I have spoken to in the last few days, the assassination on 19 October of General Wissam al-Hassan – the most important security official in the country – is every bit as serious, and could have even greater consequences. In his elegant apartment high above Tripoli, Lebanon's second city, Faisal Karami – one of Lebanon's rising politicians, the son and nephew of past Lebanese prime ministers who has been talked about as future leader himself – did not try to play down the seriousness of what has happened. "He was killed right in the middle of Beirut. It's one of the most dangerous moments for Lebanon since independence in the 1940s," he said calmly as gunfire crackled periodically outside. In the slums of Jabal Mohsen and Bab al-Tabbanneh a few miles away, Sunni gunmen were trading bullets with Lebanese Alawites, from the same Shia sect as President Assad and his fervent supporters. "We've already got a mini-civil war going. People are being shot in the streets."
In every recent crisis, despite dire predictions, Lebanon's leaders, often with foreign help, have found a way to restore a certain sense of quiet in a country that has never been properly stable. What makes it harder this time is the civil war in Syria, a short drive away, and the uncertainty right across the Arab Middle East. In the region plenty of people have no idea what will happen a month from now, let alone next year.
Lebanon's curse is that it does not control its own fate. Throughout its short history as a small and weak independent country, it has been at the mercy of its stronger neighbours. Lebanese leaders depend on the alliances they make with powerful foreigners. Inevitably that makes them party to their patrons' quarrels and wars too.
The alliances are partly based on sectarian sympathy, and plug Lebanon into one of the region's most basic conflicts, between the allies of Saudi Arabia and the west, and those who look to Iran. The leader of Lebanon's Sunnis, Saad Hariri, is the client of Sunni Saudi Arabia, which is doing all it can to unseat the Assad regime in Syria. The Assads, with Shia Iran, are the patrons of Hezbollah, the Shia movement of fighters and politicians that is the most powerful force in Lebanon.
With conflict in the region these days comes sectarianism. The Lebanese are the Middle East's experts on the subject. They know what it is like to co-exist – which is why you can see bikinis and beer on Beirut's beaches and black chadors in the city's southern suburbs – and they know too what happens when communities fall out. Power has always been parcelled out in Lebanon on sectarian lines. Sometimes the system works, but when it breaks down people reach for their guns.
As the Middle East goes through an historic transformation, sectarianism is emerging as one of the strongest features in the political landscape. It is not a new phenomenon. The faultline that divides Sunni and Shia Muslims goes back to the dawn of Islam. But it has been sharpened by the events of the last decade, starting with the American-led invasion of Iraq in 2003.
For societies that are overwhelmed by political uncertainty, with economies that do not provide enough for young populations, sectarianism is a form of friction they don't need. Using and abusing sectarianism is a good way to manipulate, to mobilise, to consolidate power, to spread chaos in the hope of gaining the upper hand.
Nationalism had a similar role in Europe in the 20th century. Sectarianism in the Middle East is as divisive, and perhaps potentially as dangerous, as nationalism used to be, and sometimes still is, for Europeans. Arab countries, and Iran, are not – yet – as militarised as the Europeans were. This is not a prediction of catastrophe. But dangers, serious ones, lie ahead.
Jeremy Bowen is the BBC's Middle East editor.