Egyptian President Abdel Fattah al-Sisi pledged "retribution" after two police officers were killed defusing bombs outside his Cairo palace Monday, almost a year after he overthrew his predecessor.
An Islamist militant group, one of several that have carried out attacks since president Mohamed Morsi's ouster on July 3 last year, warned only days ago that it had planted bombs near the palace in the east of the capital.
It was not immediately clear whether Sisi, who was the defence minister when he toppled Morsi and then won a May presidential election, was in the Ittihadiya palace at the time.
Sisi pledged "retribution" in a pre-recorded speech aired to mark the anniversary of mass protests against Morsi last year, that prompted the military led by Sisi to oust him three days later.
The interior ministry said a colonel was killed and a number of other policemen wounded when a bomb they were trying to defuse went off.
Almost an hour later, as policemen cordoned off the area and tried to defuse a second bomb, it too detonated, killing a lieutenant colonel and wounding other officers.
A paramedic's hand was blown off by the blast and blood specked a nearby white police van.
A disposal robot moved a third bomb to the middle of the street, where sappers safely defused it.
The militant group Ajnad Misr, which warned on Friday that it planted the bombs, claimed responsibility again hours after the policemen were killed.
"We targeted the fortress of the mass murderer in Ittihadiya to show that targeting other installations and police stations is even easier, and this regime will soon collapse," it said in Monday's statement.
It had said in its statement on Friday that it did not set off the bombs to avoid civilian casualties, and warned passers-by to stay away from the palace.
Attacks by militants have killed almost 500 police and soldiers since Morsi's overthrow and incarceration, according to the government.
On Wednesday, five small bombs went off in Cairo metro stations, wounding five people, followed by two bombs on Saturday in a telecommunication tower that killed a watchman's wife and daughter.
The number of attacks has fallen in recent months after police killed or arrested dozens of suspected militants.
Signup to our newsletter and follow us on Facebook and Twitter!
But the palace blasts suggests the militants still have the ability to strike heavily guarded installations.
In his speech, Sisi vowed the militants would be punished.
"Today, we lost new martyrs. I pledge before God and their families, the state will get just and speedy retribution," Sisi said.
Sisi, whom Morsi had appointed as defence minister during his single turbulent year in power, has pledged to crack down on the militants.
He won the May election with 97 percent of the vote against a weak leftist candidate on a platform of providing strong leadership to restore stability.
He was the de facto leader even before his election victory, and the Islamists blame him for a brutal crackdown that has killed at least 1,400 people in street clashes since Morsi's overthrow.
The authorities have blamed Morsi's Muslim Brotherhood for militant attacks, a charge the group denies, and designated it a terrorist organisation in December.
The Islamists say they renounced violence decades ago and are committed to peaceful protest.
A Brotherhood-led coalition, the Anti-Coup Alliance, said on Monday it would hold a "day of rage" on July 3, the anniversary of Morsi's overthrow.
The Islamists have held near daily rallies that have grown ever smaller amid the relentless police crackdown.
At least 16,000 Islamists and suspected allies have been arrested, with about 200 sentenced to death in speedy mass trials.
They include Muslim Brotherhood leader Mohamed Badie. Morsi himself faces several trials on charges which could see him sentenced to death if convicted.