CAIRO - An Egyptian appeals court overturned on Wednesday death sentences for 149 pro-Islamists accused of killing policemen in a mob attack on their station, a judicial source said.

The court ordered a retrial for the defendants over the attack, which killed 13 policemen near Cairo on August 14, 2013, the day police shot dead hundreds of Islamist demonstrators in the capital.

The initial ruling in February 2015 came amid a series of death sentences in mass trials that were criticised internationally, as the government cracked down on supporters of ousted Islamist president Mohamed Morsi.

The court had also sentenced 37 people to death in absentia, but they would have to hand themselves in for a retrial.

The grounds for the appeals court ruling were not immediately available, but the court has overturned hundreds of death sentences over the past year, to the relief of rights advocates and frustration of some in the government who have urged fast track executions.

Seven people have been executed for political violence since Morsi's ouster, including six who were convicted of belonging to an Islamist militant group.

The military overthrow of Morsi, the country's first freely elected president, ushered in the worst domestic bloodshed in the country's modern history. Morsi ruled for only a year, deeply dividing the country, and his removal was met with escalating protests by Islamists that police dispersed with live ammunition.

On August 14, 2013, less than two months after his overthrow, police broke up two protest camps in Cairo, killing about 700 protesters. Morsi's supporters around the country attacked police stations, killing dozens of officers, and torched the churches of Coptic Christians. Morsi himself is facing several trials and has already been sentenced to death in one case.

Several leaders of his Islamist Muslim Brotherhood movement, including its chief Mohamed Badie, have been sentenced to either death or lengthy jail terms. The movement has been blacklisted as a "terrorist organisation" and its assets confiscated.

The police crackdown that initially targeted Morsi supporters was later widened to include secularist and leftist leaders and activists.

Meanwhile, Egyptian security forces killed two suspected Islamist militants during clashes in the upscale Cairo district of Maadi on Wednesday, security sources said.

Egypt is trying to clamp down on Islamist militants who stepped up attacks after the army toppled president Mohammed Morsi of the Muslim Brotherhood in 2013. They have mostly targeted soldiers and police, but also attacked civilians.

Although raids against militants are common in Egypt, they are rare in neighbourhoods like Maadi, a leafy suburb which is home to a large foreign community and some of Egypt's elite.

Two police were wounded in the clashes and another two militants escaped with security forces in pursuit, security sources said.

They said police had received information that armed militants were in the area. When security forces arrived, the militants opened fire and clashes ensued, the sources said.

Weapons and explosives were found nearby, they said.