Lebanon's prime minister has formed a Cabinet that includes the militant group Hezbollah and its allies, ending a political deadlock that left the divided nation without a government for months and threatened to ignite violence.

Saad Hariri unveiled the 30-member Cabinet on Monday after more than four months of tough bargaining over who would get which portfolios.

Hariri's Western-backed political bloc narrowly defeated a Hezbollah-led coalition in June's parliamentary election, enabling it to retain a slim majority in the 128-member legislature.