(Bloomberg) -- Tunisia’s moderate Islamist party won the most seats in parliamentary elections but will still face an uphill task of cobbling together a governing coalition in a deeply polarized nation that’s fed up with politicians.

The Ennahda party won 52 seats in the 217-member parliament, the election commission announced late Wednesday. In second place with 38 lawmakers was Heart of Tunisia, the party of controversial media mogul Nabil Karoui. The Democratic Current secured 22 seats and the Dignity Coalition 21.

With no group anywhere near a majority, the rankings were fairly close to those in an exit poll published after voting finished Sunday and illustrated, once again, Tunisians’ deep frustration with mainstream parties.

While the North African country has made solid democratic gains since the 2011 ouster of President Zine El Abidine Ben Ali -- as shown by its vibrant elections -- many of its 11.5 million people say the government has failed to improve their lives. Sporadic militant attacks have battered the vital tourism sector, while disputes with powerful unions are stalling the enactment of economic reforms backed by the International Monetary Fund.

(Adds more results in second paragraph.)

To contact the reporter on this story: Jihen Laghmari in Tunis at jlaghmari@bloomberg.net

To contact the editors responsible for this story: Alaa Shahine at asalha@bloomberg.net, Michael Gunn, Karl Maier

©2019 Bloomberg L.P.