Lebanon's President Michel Aoun (C) meets with Prime minister-designate Saad al-Hariri (R) and Parliament Speaker Nabih Berri at the presidential palace in Baabda, Lebanon December 18, 2016. Dalati Nohra/Handout via Reuters

BEIRUT (Reuters) - Lebanon’s President, Michel Aoun, and Prime Minister Saad al-Hariri have formed a new government of 30 ministers drawn from most sides of the country’s political spectrum and from all of its religious sects, the cabinet office said on Sunday.

“Today a new government was formed,” said Hariri, after the announcement.

Aoun, an ally of the Shi’ite group Hezbollah which dominates the country’s politics, was elected president by members of parliament in October, after more than two years without anyone occupying Lebanon’s highest office of state.

His election was partly the result of a political deal under which he would ask Hariri, a former political opponent, to be prime minister. However, some leading Lebanese politicians did not support the deal, contributing to Hariri’s delay in being able to form a government.

Lebanon has had a caretaker government for more than two years, led by former prime minister Tammam Salam, contributing to a political crisis that has weakened government services.

Among the main cabinet posts, Gebran Bassil, a Christian and ally of Aoun, stays on as foreign minister, while Ali Hassan Khalil, a member of the Shi’ite Amal party to which Parliament Speaker Nabih Berri belongs, remains finance minister.

Nouhad Machnouk, a Sunni Muslim and member of Hariri’s Future Movement, retains his post as interior minister. The new defense minister Yacoub al-Sarraf is a political ally of Aoun. The other important post, energy and water minister, went to Cesar Abou Khalil.