BEIRUT, Lebanon — Lebanon formed a new government on Thursday, ending nine months of wrangling and deadlock with a statement by Prime Minister Saad Hariri, who said bold moves were needed to address chronic problems facing the nation.

The government of Mr. Hariri, who has Western backing, includes most of Lebanon’s parties. Hezbollah, the powerful, Iran-backed Shiite group, emerged stronger from the parliamentary election last May thanks to gains by its allies, and it chose to fill the post of the new health minister.

Celebratory fireworks burst over Beirut shortly after the deal to form a new government was announced.

In a statement read from the presidential palace, Mr. Hariri apologized to the people of Lebanon for the time it had taken to form the government and noted that they were “living in concern” over the economy.