Though the country's two largest politicial parties, the Socialist Union of Popular Forces (USFP) and the conservative Istiqlal lead the polls, many town halls slipped out of their control.
The USFP and the Istiqlal head Morocco's coalition government. But in a fragmented political landscape of 26 parties, they needed alliances to secure the coveted posts of mayors.
In some cities, there were disputes between the two.
It got worse after Monday's vote for mayor of capital Rabat, traditionally a USFP fiefdom.
The USFP was disappointed when Istiqlal's support for its candidate did not materialise. The new mayor is from a third party.
State-run television showed chaotic scenes, nearly ending in rivals coming to blows.
Casablanca, the country's largest city and its economic hub, has also got a new mayor who does not belong either to the USFP or Istiqlal.
Mayor Muhammad Sajid belongs to the small Constitutional Union (UC).
UC won only 11 seats on the city council, compared with Istiqlal's 19 and the USFP's 17. But Sajid got the support of smaller coalition parties, as well as the Islamists of the Justice and Development Party (PJD).
"Suicide of the whales," said a prominent newspaper on Thursday in summing up the debacle of the two big parties in mayoral elections.