Morocco's Islamist party has dominated urban areas in local elections, but lost out in total seats to a liberal opposition party in local polls, preliminary results suggest.

With 81 percent of ballots counted on Saturday, the Party of Authenticity and Modernity took 20 percent of votes, translating into 5,064 seats. The ruling Justice and Development Party got 17 percent of the votes, winning control of councils in the main cities of Casablanca, Tangiers, Rabat, Fez and Agadir.

About 30,000 local council seats and 700 regional council seats were contested by more than 140,000 candidates from at least 30 parties. The interior ministry reported a turnout of 52 percent.

Important test

The elections were seen as an important test of the popularity of the Islamist-led government which came to power after the pro-democracy demonstrations of the 2011 Arab Spring.

Inside Story: Morocco votes

The councils manage local affairs in conjunction with state-appointed officials and are being strengthened under a new government policy of regionalisation.

The Party of Authenticity and Modernity was created in 2008 by one of the king's counsellors and it dominated local elections the following year. 

It fared poorly, however, in the 2011 parliamentary elections.

Those elections were dominated by the Islamist opposition party that went on to form a government.

Unlike their counterparts elsewhere around the region, Morocco's Islamists have played down religious issues in their campaigns and preferred to focus on combatting corruption and unemployment.

The Justice and Development Party, and its charismatic leader Abdelilah Benkirane, have preserved their popularity despite implementing austerity measures and cutting energy subsidies in order to reduce the budget deficit.

Source: Agencies