A police raid on suspected militants in the Moroccan city of Casablanca has set off gunfights and suicide bombings that have left at least five men dead.
The police raid took place in an impoverished residential area
One of the men was shot dead by police in a raid on an alleged militant hideout in a poor area of the city.
Another three suspected militants blew themselves up during the police manhunt. A police officer also died in one of the blasts.
Suicide bombers killed more than 40 people in Casablanca in 2003.
They targeted the city's ancient Jewish centre, tourist spots and a diplomatic complex.
Moroccan police said the man they shot dead on Tuesday, named as Mohamed Mentala, was wanted in connection with the 2003 attacks.
The other three men were believed to be linked to a suicide bomber who blew himself up in a Casablanca internet cafe last month, as police tried to arrest him.
According to Richard Hamilton, the BBC's correspondent in Rabat, the police will be pleased that the bombers this time were intercepted before they could reach more crowded targets.
Moroccan officials say they recently foiled a militant plot to bomb foreign and security targets in the country.
Tuesday's violence began at dawn, when police raided a suspected militant hide-out in Casablanca's El Fida district.
One man blew himself up after a brief rooftop confrontation with police.
Security forces believe the militants were planning large attacks
According to interior ministry officials quoted by the Associated Press news agency, another man shot dead in the raid was found to have explosives on his body.
As police combed the area later that afternoon, a third man blew himself up after reportedly jumping from a balcony.
The blast also killed a policeman and left another hurt.
A fourth suspected militant blew himself up later after approaching a police cordon.
A woman who witnessed the police raid said she saw a suspect "on the ground, dead, with his backpack on".
Another witness, a man, said he saw a suspect cornered on a rooftop.
"Two police inspectors turned up. They were below him, below a wall. When they were about to hit him, he blew himself up in front of our eyes. Everything went red."
The situation is calm in the city, events occurred in the outskirts of Casablanca 15km from downtown.
Ali Amar, Casablanca, Morocco
This, yet again, just proves how effective both Moroccan intelligence services and the police are - let alone the general public. I feel safer here than anywhere in Europe.
James Cutting, Marrakech, Morocco
Oh my god, I am so scared and shocked by these terrible actions. Hopefully this will be the last bomb I see in my life because seriously I cannot stand this anymore. Please help us find a solution to end this problem.