Lebanon’s parliament elected Hezbollah-backed Michel Aoun president on Monday after two and a half years of having the position unfilled.

Aoun, 81, failed to secure the necessary votes – a two-thirds majority – in the first round of voting. He however received more than the required 65 votes from the 128-seat chamber in the second round.

A former general, Aoun is a Maronite Christian and a leader of the Free Patriotic Movement party who was forced into exile from his post as Prime Minister of one of two rival governments by the Syrian army 26 years ago.

He guaranteed himself a majority after the head of the opposition, Sunni leader and former prime minister Saad Hariri, announced his endorsement.

Open gallery view Christian politician and FPM founder Michel Aoun talks during a news conference in Beirut, Lebanon October 20, 2016. Credit: Mohamed Azakir, Reuters

In return, it seems Hariri will return as prime minister, a job reserved by the Lebanese constitution for a Sunni Muslim, while the president must be a Christian.

Israel came up in remarks made by Lebanese Parliament Speaker Nabih Berri after the vote: "Israel is still a threat to Lebanon your leadership will face tremendous challenges in the shadows of significant events in the region, the most prominent among them being, the war in Syria," Berri told Aoun.

Aoun, speaking after his election, alluded to the conflict with Israel as well, saying: "We will always be ready to help and support the resistance forces in order to liberate every last meter of Lebanese territory that has not yet been returned and the attempts to take over natural resources."

Aoun also said that "strengthening the Lebanese army will be at the top of my agenda, likewise reinforcing the Lebanese economy and society."

The new president also pledged to "confront the issue of refugees arriving from Syria in order to return them to their homeland... with regard to the Palestinian refugees, we shall always aspire to implement the right of return for those refugees."

Open gallery view Celebrating the election of former general Michel Aoun as president, on October 31, 2016 Credit: AFP / ANWAR AMRO

Last week Hezbollah secretary general Hassan Nasrallah said he did not rule out Hariri serving as prime minister. His statement gives support to the theory that a deal had been negotiated between the sides over the past few weeks.

After he announced his support for Aoun, Hariri visited the residence of Maronite Patriarch Bechara Boutros al-Rahi to receive his blessing. Hariri described his decision earlier this month as necessary to “protect Lebanon, protect the [political] system, protect the state and protect the Lebanese people.”

He said his endorsement came after he had exhausted all other options, and that he intended “to preserve the political system, reinforce the state, relaunch the economy and distance us from the Syrian crisis.”

Open gallery view Lebanon's former Prime Minister Saad Hariri walks into the parliament building in Beirut, October 31, 2016. Credit: Mohamed Azakir, Reuters

Lebanese security forces were very worried about a possible terror attack or other major incident that would interfere with the election, particularly from groups such as the Islamic State.

Many in Lebanon and the Arab world see the election as an opening for optimism in the region, and possibly a sign of Saudi Arabia's weakening as the sponsor of many parties and political organizations in the Arab world — and in particular Hariri’s anti-Syrian March 14 Alliance.

Aoun’s election ends a 29-month-long vacuum in the presidency, part of a political crisis that has paralyzed Lebanon’s government and raised concerns over its future as civil war rages in neighboring Syria.

Open gallery view Supporters of Lebanese president Michel Aoun waving political flags in the outskirts of Beirut, October 31, 2016. Credit: Anwar Amro, AFP

However, doubts remain over Aoun’s ability to forge the cross-community consensus needed to make his administration succeed. “I do not know to what degree he will be able to reconcile the great contradictions that his rule will group together,” said Nabil Boumonsef, a political commentator at An-Nahar newspaper.

An Aoun victory marks a remarkable turn of fortune for the former general who fought two wars in the late 1980s at the end of Lebanon’s 1975-90 civil war — one against Syria and the other against rival Christian forces.

His subsequent alliance with Hezbollah, backed by its Syrian and Iranian patrons, helped to cement divisions in the once dominant Maronite Christian community. But it also angered the United States, which views Hezbollah, a heavily armed group and Syria’s strongest Lebanese ally, as a terrorist organization.

His election will also be viewed as a victory for Hezbollah, Tehran and Damascus over Hariri’s Sunni allies in Riyadh at a time when Saudi Arabia has appeared to retreat from Lebanon as it prioritizes fighting Iran in the Gulf. It will also raise questions over Western policy towards Lebanon, whose army depends on U.S. military aid.

Triggered by financial misfortune, Hariri’s concession is seen as the last resort to secure the political survival of a man who has accused Syria of killing his father, Rafik. Hariri’s standing in Lebanon has been hit by the financial crisis caused by troubles at his Saudi-based construction firm.