BEIRUT (AP) — Lebanon's parliament elected former army commander Michel Aoun as president on Monday, filling a post that had been vacant for more than two years and injecting hope that the country's long-running political paralysis would come to an end.
But the 81-year-old retired general who presided over the final bloody chapters of the Lebanese civil war and is a strong Hezbollah ally has an unenviable task ahead — forming a government out of the country's unruly political factions and dealing with an array of problems that includes what to do with more than 1 million Syrian refugees who have fled the war in neighboring Syria.
Aoun, a Maronite Christian, enjoys a wide base of support among Lebanon's educated Christians, but is a deeply divisive figure for his role in the 1975-90 civil war and for his shifting alliances, especially with Hezbollah, the country's most powerful military and political force. His election was seen by many as a clear victory for the pro-Iranian axis in the Middle East, giving a boost to Hezbollah and the Shiite Lebanese group's ally, Syrian President Bashar Assad.
Aoun secured a simple majority of votes in parliament after a tension-filled, chaotic session that saw several rounds of voting because extra ballots appeared in the ballot box each time. In the end, the transparent box was placed in the middle of Parliament, where lawmakers cast their votes in front of two witnesses who watched to make sure no extra ballots were put in.
"We haven't voted in a long time. We're learning again," Parliament Speaker Nabih Berri joked of the nearly two-hour process.
In the end, Aoun garnered 83 votes out of 127 lawmakers present at the session. He had been widely expected to achieve a two-thirds majority in the first round, but failed by two votes.
Members of parliament broke out in applause after Aoun was finally declared president. His supporters across the country erupted in cheers as they watched the proceedings on screens set up in the streets. Celebratory gunfire could also be heard in the capital.
"I'm with Hezbollah, and my hand is with Hezbollah, and we are with Aoun," said Khalil Shukr, a 21-year-old supporter who wore a yellow T-shirt, the color of the Hezbollah flag.
"We've got a president today who will take care of all the Lebanese, all of Lebanon, not just one faction," added Shukr, standing among a crowd gathered at the Mar Yousef church in Aoun's childhood hometown of Haret Hreik, now a crowded Beirut suburb dominated by Hezbollah.
"There are going to be obstacles, but he is a strong man and is impartial, and we are hopeful things will change, that he will fight back corruption," said Aida Ghanimeh, a 46-year-old supporter, as she watched the vote on a giant screen in the capital, Beirut.
The election comes at a time of great regional upheaval, especially in neighboring Syria, where the civil war has repeatedly spilled over into Lebanon. In a televised speech to lawmakers shortly before he was sworn in, a somber-looking Aoun acknowledged the challenges ahead.
"Lebanon is passing through minefields and has been safe from the raging regional fires, and we will prevent any spark from reaching it," he said.
Among the first congratulatory phone calls Aoun received was from Iranian President Hassan Rouhani. "We are certain that with your election, the resistance movement will be strengthened," the Iranian leader told him, according to Rouhani's website. Assad and Hezbollah leader Sayyed Hassan Nasrallah also congratulated Aoun in phone calls.
In Washington, State Department spokesman John Kirby described Aoun's election as a "moment of opportunity" to restore government institutions as Lebanon emerges from years of political impasse.
However, Israeli opposition leader Yair Lapid, who has topped recent Israeli polls, said Israel should worry when Lebanon elects a president who has the backing of Hezbollah, adding that the militant movement is bound to turn its aggression toward Israel once the war in Syria comes to an end.
Lebanon has been without a head of state for 29 months after President Michel Suleiman stepped down at the end of his term in May 2014. According to Lebanon's sectarian-based power-sharing system, the president must be a Maronite Christian, its parliamentary speaker a Shiite Muslim and its prime minister a Sunni Muslim.
Parliament failed 45 times to elect a new president due to political infighting that led to a lack of a quorum as Aoun's bloc and allied Hezbollah lawmakers boycotted the sessions because his election was not guaranteed.
In the end, it took an about-face by former Prime Minister Saad Hariri, Lebanon's Saudi-backed Sunni leader, who formally endorsed Aoun for president last week — reportedly in exchange for Aoun promising him the position of prime minister.
That endorsement was the final piece of an unlikely coalition that left parliamentary speaker Berri, a Shiite strongman who is accustomed to playing kingmaker in Lebanese politics, on the sidelines of the show.
Aoun will now have to bring Berri, a longtime rival, back into the fold.
"I think everyone's interests are aligned with getting through this with minimum damage," said Ayham Kamel, an analyst at the London-based think tank Eurasia Group, who predicted Hariri would again be called upon to form a Cabinet.
Aoun "cannot make miracles, but he can be an arbiter," said Hanna Anbar, executive editor of The Daily Star, who covered the last days of the civil war holed up in the presidential palace with Aoun. "If he can clear certain hurdles that will be enough to run a smooth presidency and a smooth government."
There is, however, one party that comes out of the maneuvering on top.
With its reliable ally Aoun as president and its Shiite political partner, Berri, running parliament, Hezbollah is in the powerful position of mediating between the two main branches of government.
"There will be active mediation by Hezbollah to try to narrow the differences between Berri and the other parties, and I think there's going to be a grand bargain," Kamel said.
Following Monday's parliamentary vote, Aoun drove to the presidential palace in the southeastern Beirut suburb of Baabda, returning exactly 26 years after he was forced out of it as army commander and interim premier by Syrian forces and Lebanese troops loyal to a rival commander.
On Wednesday, he is expected to begin consultations with lawmakers over their choice for prime minister.
Associated Press writers Bassem Mroue in Beirut and Amir Vahdat in Tehran, Iran, contributed to this report.