Militants killed 25 policemen on Monday in the deadliest attack of its kind in years, as Egypt struggles to deal with violent unrest sparked by Islamist president Mohamed Morsi's ouster.
Sources said the militants fired rocket-propelled grenades at two buses carrying police in the Sinai Peninsula, just hours after Egypt's military chief vowed a "forceful" response to violence roiling the Arab world's most populous nation.
The attack raised fears of a return to the wave of deadly Islamist violence that swept Egypt in the 1990s.
It comes as the country struggles to put a lid on a deep political crisis and bloodshed that has left almost 800 people dead in several days of clashes between Islamist protesters and security forces throughout Egypt.
Among those killed in the latest violence were 36 Islamist detainees who died in police custody overnight, with authorities saying they had suffocated on tear gas fired after they took a police officer hostage.
Morsi's supporters vowed new demonstrations on Monday, although a day earlier they had cancelled several marches citing security concerns.
The Sinai attack left at least two other policemen injured, with unknown militants firing on buses carrying police as they headed towards the town of Rafah on the border with the Gaza Strip.
The interior ministry blamed the attacks on "armed terrorist groups," and a border official said shortly afterwards that the Rafah crossing with the Palestinian territory would be closed.
Security sources later said that another policemen was killed in the northern city of El-Arish, the latest deaths bringing to at least 75 the number of security force members killed in the Sinai since the army deposed Morsi on July 3.
The security situation in the Sinai has deteriorated sharply over past weeks, with near daily attacks by militants targeting police and military installations.
Elsewhere in the country, bloodshed sparked by the August 14 security force crackdown on pro-Morsi protest camps in Cairo showed little sign of abating.
Authorities said 36 Islamist detainees died after police fired tear gas in a bid to free a police officer taken hostage by prisoners, as the prisoners were being transferred to a north Cairo jail.
But the Muslim Brotherhood, the once-banned movement from which Morsi hailed, held the police accountable.
"The murder of 35 detained anti-coup protesters affirms the intentional violence aimed at opponents of the coup, and the cold-blooded killing of which they are targets," it said in a statement in English.
The deaths of the detainees came hours after military chief Abdel Fattah al-Sisi warned that security forces would confront any violence from protesters.
"We will never be silent in the face of the destruction of the country," said Sisi, who overthrew Morsi last month after mass protests against the Islamist president's rule. He pledged a "forceful" response to further attacks on police and government buildings.
According to an AFP tally, more than 1,000 people have been killed since mass demonstrations against Morsi erupted at the end of June, among them a son of the Brotherhood's supreme guide who died on Friday.
The violence sparked by the crackdown launched last Wednesday has drawn international condemnation.
European ambassadors were recalled from their summer break for a meeting Monday in Brussels, with EU foreign ministers due to review the bloc's ties with Egypt at an emergency meeting on Wednesday.
The European Union has pledged nearly five billion euros ($6.7 billion) in aid to Egypt but the bloc has cautioned this was under "constant review" after Morsi's ouster.
The United States has announced the cancellation of its biannual military exercise with Egypt, and its embassy in Cairo was closed Sunday for security reasons.
The White House has stopped short of suspending $1.3 billion in annual aid, although some US lawmakers called Sunday for the funds to be cut.
But the international response has not been uniformly critical. Both Saudi Arabia and Jordan have said they back Egypt in its fight against "terrorism".
In Israel, an official quoted in the Jerusalem Post said now was the time for the West to support rather than sanction the military in Egypt.
"The name of the game right now is not democracy," he added. "The name of the game is that there needs to be a functioning state. After you put Egypt back on track, then (you can) talk about restarting the democratic process there."
In the 1990s, Egypt was hit by major attacks linked to Islamist groups such as Gamaa Islamiyya and the Islamic Jihad, with targets including government officials and security forces, Coptic Christians and the country's lifeblood tourism industry.