Cairo: Gunmen on a motorbike shot dead an Egyptian policeman while two suspects in a failed bomb attack targeting a judge were killed in a shoot-out with police, officials said Monday.

Militants have carried out regular attacks on policemen and soldiers since the army overthrew Islamist president Mohammad Mursi in July 2013.

Militants say their assaults are in retaliation for a government crackdown against Mursi’s supporters that has left hundreds dead and thousands jailed.

The gunmen on a motorbike opened fire on a policeman during the night near a court in Belbeis, a town around 60 kilometres (about 38 miles) northeast of Cairo, a police official said.

The policeman died in hospital.

In a separate incident, police killed two men suspected of involvement in a failed bomb attack that targeted judge Mutaz Khafagi in Cairo last week, the interior ministry said in a statement.

The two suspects, who lived in a Cairo suburb, were shot dead in a firefight when police went to arrest them, the ministry said without specifying when they were killed.

Khafagi sentenced 12 men to death in August 2014 after convicting them of murdering a police general in the town of Kerdasa near Cairo during a police crackdown targeting Mursi’s supporters.

He also sentenced Muslim Brotherhood chief Mohammad Badie to life in prison in February.

On May 10, three small bombs exploded outside Khafagi’s home in Cairo, wounding four people and damaging the building.

Khafagi was in his first-floor apartment at the time of the attack but was not wounded.

Rights groups accuse the authorities of using the judiciary as a tool to repress all kinds of opposition to the regime of President Abdul Fattah Al Sissi.

Since the ouster of Mursi, hundreds of his supporters have been sentenced to death after speedy mass trials, described as the United Nations as “unprecedented in recent history”.

On Saturday, Mursi himself was sentenced to death along with more than 100 co-defendants for their role in a mass jailbreak during the 2011 uprising, in a verdict denounced by rights groups as well as US and EU officials.