UN Secretary General Ban Ki-moon has welcomed the election of a president in Lebanon, calling for an immediate formation of a new government in the country which had been without a head of state for 29 months.

Ban on Monday extended his congratulations on the election of Michel Aoun as Lebanon’s president.

He “hopes that Lebanese parties will now continue to work in a spirit of unity and in the national interest,” Ban’s spokesman said in a statement.

The UN chief “encourages the formation without delay of a government that can effectively serve the needs of all Lebanese citizens and address the serious challenges facing the country,” the statement added.

Lebanese President Michel Aoun poses with the presidential medal at the presidential palace of Baabda, east of Beirut, on October 31, 2016. (Photo by AFP)

On Monday, the Lebanese lawmakers elected retired general Aoun as the country’s president when they convened for their 46th attempt to choose a head of state.

Aoun secured the presidency by winning the support of 83 MPs, well above the absolute majority of 65 needed to win.

Lebanon had been without a head of state since 2014, when the term of President Michel Suleiman expired.

Under Lebanon’s power-sharing system, the president must be a Christian, the prime minister a Sunni Muslim and the parliament speaker a Shia Muslim.

According to some Lebanese political sources, Saad Hariri is expected to be given the post of prime minister for the second time.

The election of 81-year-old Aoun put an end to more than two years of the political vacuum in Lebanon.