The Lebanese parliament has elected former army commander Michel Aoun as president, ending a 29-month presidential vacuum as part of a political deal that is expected to make Sunni Muslim leader Saad al-Hariri prime minister.
Aoun, who is in his 80s, secured the presidency by winning the support of 83 MPs, well above the absolute majority of 65 needed to win, according to a tally of votes read out in a televised broadcast from parliament.
Fireworks echoed across Beirut as the tally showed Aoun the winner. Aoun, an MP, was shown smiling in his seat. The Lebanese presidency is reserved for a Maronite Christian in the country's sectarian power-sharing system.
Hariri's decision to endorse Aoun marked a major political concession reflecting the diminished role of Saudi Arabia in Lebanon, and the decisive influence wielded by the Tehran-backed Hezbollah. Saudi Arabia had backed Hariri and his allies through years of political struggle with Hezbollah and its allies.
Hariri's own financial misfortunes have also played a big part in bringing about the breakthrough. His political network in Lebanon was hit by a cash crunch caused by financial troubles at his Saudi-based construction firm, Saudi Oger.
Analysts say the position of prime minister, which he previously held from 2009 to 2011, should help him shore up his support ahead of parliamentary elections that are due to be held next year.
Aoun is due to meet MPs later this week on their preferences for prime minister. He is obliged to designate the candidate with the greatest support among MPs, expected to be Hariri.