The death toll has risen from the shooting near the French embassy in Tanzania.
Three police officers and a private security guard had been killed by a gunman in the economic hub of Dar es Salaam, police said.
The unidentified shooter was killed.
Head of police operations Liberatus Sabas told reporters that the motive of the gunman was still not known.
Six other people were also injured.
“Residents should remain calm as we investigate the matter,” Mr. Sabas said.
President Samia Suluhu Hassan tweeted that the attacker had been “neutralized” and that calm had been restored.
Read Also: We will not protect unprofessional police officers – Kwesi Ofori, ACP