With multiple wars being waged in the Middle East over religious differences, Lebanon has decided that it must hold even tighter to its constitutional democracy and especially its unique formula of peaceful coexistence between its many sects. On Monday, its parliament ended a long stalemate between the country’s religious-based political factions and chose a new president, Michel Aoun, a Maronite Christian.

The post had been empty for more than two years, a result in large part of the regional rivalry between Iran and Saudi Arabia over which one represents Islam in the Middle East. Lebanon’s domestic politics are complex but they are easily influenced by outside forces. With the war next door in Syria getting worse, Lebanon was ready to reassert its model of political reconciliation under an arrangement dating back to the 1940s.

Electing a Christian as president is now expected to lead to choosing a Sunni Muslim as prime minister, which will most likely be Saad Hariri, a local businessman and son of former prime minister. The speaker of the parliament is a Shiite Muslim, Nabih Berri.

The Lebanese don’t just read about Syria’s war. One in 4 people in the country is a Syrian refugee. And one Lebanese group, the powerful Shiite Islamist group, Hezbollah, helps prop up the Syrian regime with its militia. Such proximity to war only helps reinforce a popular desire for resolving disputes.

The Middle East needs more models like Lebanon to show how different faiths can share power through constitutional means. Lebanon learned from its own 1975-1990 civil war that sectarian coexistence is essential. At the same time, its young people are more demanding of secular government. An estimated 20 percent of marriages are now between Sunnis and Shiites (dubbed “SuShi”), or between Muslims and Christians.

Lebanon’s politics must still evolve away from sect-based political leaders. The new president and the next prime minister will need to rise above their religious constituencies to solve the country’s many problems, such as electoral reform. Behind the scenes, many of the country’s religious leaders have worked together to support a constitutional democracy, one in which minority faiths are respected.

Together with Tunisia’s example as an Arab democracy that is lessening religious tensions, Lebanon has taken a big step to be a worthy example in a region torn by violence between rival sects.