Two policemen were killed in the Egyptian city of Alexandria in a bomb attack on Saturday that targeted the local security chief two days before a presidential election.
Five other people were wounded by the bomb, which was left under a car and blew up as police Major General Mostafa al-Nemr drove past, the Interior Ministry said. Nemr was not hurt and said later he would not be deterred from "doing his duty" in safeguarding next week's vote.
There was no immediate claim of responsibility for the blast, which the state news agency blamed on the banned Muslim Brotherhood organisation. Daesh released a video last month in which it warned Egyptians against voting and urged militants to attack security forces and leaders.
The government condemned the attack and suggested it would not affect the election beginning on Monday in which President Abdel Fattah al-Sisi is set to win a second term.
"These desperate attempts by the forces of terrorism and the states that back it to affect the positive atmosphere the country is witnessing will only increase the Egyptian state's resolve to complete its political process and economic progress," Prime Minister Sherif Ismail said.
Photos posted on social media showed a burnt out car and smoke at the site of the blast. Local television stations later showed Nemr unharmed and inspecting the area.
Residents close to the scene in Alexandria, Egypt's second-largest city, reported hearing a huge blast when the bomb detonated mid-morning.
"I suddenly heard a very strong explosion and ran towards the street, but I retreated out of fear," said Mohamed Ismail, a doorman at a building near the explosion.
"I thought the building would collapse and kept checking on its pillars," he added.