Islamic militants ambushed two mini-buses carrying off-duty policemen in the northern region of Egypt's Sinai peninsula on Monday, killing 25 of them in a brazen daylight attack.

The killings, which took place near the border town of Rafah, came a day after 36 detainees were killed in clashes with security forces. In all, nearly 1,000 people have died since last Wednesday in clashes between security forces and supporters of the ousted president, Mohammed Morsi.

Tensions between the sides have been high since the army ousted Morsi in a3 July coup, following days of protests by millions of Egyptians accusing him of abusing his powers and demanding his resignation.

Morsi's supporters, however, have fought back, staging demonstrations demanding his reinstatement and denouncing the military coup.

On Wednesday, the military raided two protest camps in Cairo, killing hundreds of people and triggering the current wave of violence.

General Abdel Fatah al-Sisi, the country's military chief, said on Sunday that the crackdown, followed by a state of emergency and a night-time curfew imposed in Cairo and several other flashpoint provinces, is needed to protect the country from civil war. Sisi has vowed that the military will stand firm in the face of rising violence, but also called for the inclusion of Islamists in the post-Morsi political process.

Sinai, a strategic region bordering the Gaza Strip and Israel, has witnessed almost daily attacks since the ousting of Morsi, leading many to link the militants there to the Muslim Brotherhood, the Islamist group from which Morsi hails.

Egyptian military and security forces have been engaged in a long-running battle against militants in the northern half of the peninsula.

Al-Qaida-linked fighters, some of whom consider Morsi's Brotherhood to be too moderate, and tribesmen have used the area for smuggling and other criminal activity for years, and have on occasion fired rockets into Israel and staged cross-border attacks.

A year ago, 16 Egyptian border guards were killed in Sinai near the borders with Gaza and Israel in a yet unresolved attack that is widely blamed on militants.

In Monday's attack, the militants forced the two vehicles to stop, ordered the policemen out and forced them to lie on the ground before shooting them. The policemen were in civilian clothes, officials said, speaking on condition of anonymity because they were not authorised to talk to the media. There was no immediate claim of responsibility for the attack, which also left two other policemen wounded.

Officials initially said the policemen were killed when the militants fired rocket-propelled grenades at the two minibuses. Such confusion over details in the immediate aftermath of attacks is common. Egyptian state television also reported that the men were killed execution-style.

The killings, which took place near the border town of Rafah, compound Egypt's woes a day after police fired teargas to free a prison guard from rioting detainees in clashes during which at least 36 people were killed.

Officials said the detainees had rioted and managed to capture a police officer. The were part of a prison truck convoy of some 600 prisoners heading to Abu Zaabal prison in northern Egypt.

Security forces fired teargas into the truck in efforts to free the badly beaten officerand those killed died from suffocation. officials said.

The officials' version of the event, however, contradicted reports about the incident carried by state media. The state television website reported that the deaths took place after security forces clashed with militants near the prison and detainees came under fire while trying to escape. The official MENA state news agency also said the trucks came under attack from gunmen.

State media said the people killed and the gunmen belonged to the Brotherhood. The officials who spoke to AP said some of the detainees belonged to the Brotherhood, while others didn't. The differences in the accounts could not be immediately reconciled.

The Brotherhood said in a statement that it blamed Sisi and the interior minister, Mohammed Ibrahim, who is in charge of the police, for the attack. The group also called for an international inquiry into the deaths.

Along with the state of emergency imposed after Wednesday's crackdown, the military-backed interim government has also begun taking harsher measures to cripple the Brotherhood.

Security forces arrested hundreds of members on Sunday in raids on their homes in different cities, aimed at disrupting planned rallies in support of Morsi. The cabinet also held an emergency meeting to consider banning the group.

A possible ban, which authorities say would be implemented over the group's use of violence, would be a continuation of the decades-long struggle between the state and the Brotherhood. It also would drain the group's financial resources and allow for the mass arrest of its members. That would likely diminish the chances of a negotiated solution to the crisis and push the group underground again.

The Brotherhood, however, has shown no signs of backing down.

Under the banner of an anti-coup alliance, the group held protests on Sunday, though many appeared smaller in scale than in recent days. In the coastal city of Alexandria, protesters clashed with residents. In the southern city of Assiut, security forces fired teargas to disperse hundreds rallying in front of a mosque.

"They think they can end the movement," said senior member Brotherhood member Saad Emara. "The more killings, the more people join us."

The government blames Islamists for a series of attacks on churches and police stations, increasing public anger against the group.

In his first public appearance since last Wednesday, Sisi spoke at length on Sunday about the motives behind the ousting of Morsi. The general said the Islamist president exploited democracy to monopolise power. He again said the military's action "protected Egyptians from civil war", despite the ongoing violence on the streets.

"We will not stand by silently watching the destruction of the country and the people, or the torching the nation and terrorising the citizens," Sisi said in a speech aired on state television. "I am not threatening anyone ... If the goal is to destroy the country and the people, no!"

The general said that the military didn't seek power but instead "have the honour to protect the people's will which is much dearer [than] ruling Egypt".