CAIRO: An Egyptian court on Saturday upheld death sentences for seven men over the killing of 25 policemen in the Sinai Peninsula last year and for collaborating with Al-Qaeda.

The policemen were killed in an ambush in August 2013 in the North Sinai town of Rafah in what was one of the deadliest militant attacks targeting security forces.

It came just weeks after the army ousted President Muhammad Mursi following mass street protests against his one-year rule.

On Saturday, the court confirmed preliminary death sentences handed down in October against the seven men, including militant Adel Habara, after they were ratified by the country’s mufti, or top cleric.

The sentences are subject to appeal.

Habara previously has been convicted in several other cases, including bomb attacks in southern Sinai between 2004 and 2006, officials said.

Three other suspects in last year’s ambush were sentenced to life in prison, while 22 others were jailed for 15 years. Life imprisonment in Egypt is 25 years in jail.

Three defendants were acquitted, the court said in a verdict broadcast live on state television.

Prosecutors say militants intercepted two buses carrying the policemen in Rafah, a town bordering Israel and the Gaza Strip, and later killed them.

“The defendants committed the listed crimes because of their belief in the ideology of terrorist organization Al-Qaeda, which considers the head of state as an infidel and legitimizes insurgency,” the judge said.