People at the scene of the attacks in Casablanca have been describing their experiences as the bombs exploded.
Bombers were reportedly turned away from a second restaurant
The most deadly blast appeared to be at a Spanish restaurant, the Casa de Espana.
An employee at the restaurant, Lamia Haffi, said three attackers entered the building after killing a security guard by cutting his throat with a large knife.
"I saw the doorman's chair, it was covered in blood. And then, inside, there were bodies. Bodies everywhere," she told Spanish radio.
The head of the Spanish centre, Rafael Bermudez, said there was panic.
"You heard the bombs and everything caught fire. Everyone hit the ground and ... there was blood everywhere. It was horrendous," he said.
"There wasn't time to do anything. Seeing all this and having to get over all the bodies, it was horrendous."
Mohammed Zerrouki, a medical technician having dinner and playing bingo with his friends, suffered minor head wounds in the blast.
"We had just been served paella, and they were calling out the numbers. Then, 'Boom!' a first blast - it was like a thunderclap," he told The Associated Press news agency.
Local journalist Abubakr Jammai told the BBC that witnesses had spoken of "many dead" and injured. He said there was a big hole where the entrance of the Safir Hotel used to be.
"There are body parts all over the place," he said.
There was absolutely no warning - nobody was expecting this
A British man who had been out to dinner was returning to the hotel when he heard a bomb go off.
"The reception area and the bar on the first floor were blown completely out," he told PA news agency.
"It was pretty chaotic. It was a bit surreal and I just didn't quite think it was real."
Hassan Alawi, a journalist who visited three of the bomb sites in the city, said it was like being in a war scene.
"There was debris everywhere, broken glass, cars completely destroyed, windscreens missing, flashing lights," he said.
"There was absolutely no warning, nobody was expecting this."
Television pictures showed people milling around, looking confused. A number of people were clutching their heads and walking around in shock.
One man was crying, sitting on the floor, and one woman was sitting with blood dripping from her arm.
Outside the hotel, a series of cars had had their windscreens blasted out by the force of the bomb.
One device exploded near the Belgian consulate. Reports suggested attackers were targeting an Italian restaurant popular with the Jewish community but were refused entry.
"I was working in the Positano restaurant when I heard a bomb explode suddenly, in the blink of an eye," one worker told Moroccan television.
"There were two casualties, one of whom had been decapitated. There were also two different legs which did not belong to the same body."