Egyptian security forces have grown accustomed to being targeted by Islamist militants. Now some judges are buying guns for protection after a spate of attacks which suggest that they too are on the hit list.
Militants are estimated to have killed more than 600 soldiers and police since the army toppled President Mohamed Morsi of the Muslim Brotherhood in 2013.
A violent campaign against judges could spell trouble for President Abdel Fattah al-Sisi, who has only just managed to deliver some stability following years of upheaval in Egypt.
Late on Wednesday, Islamic State's Egypt affiliate urged followers to attack judges, declaring a new front in an insurgency in the world's most populous Arab state.
"It is wrong for the tyrants to jail our brothers," said cleric Abu Osama al-Masry, who heads Sinai Province, referring to judges in an audio statement posted on a prominent jihadist website.
"Poison their food...surveil them at home and in the street...destroy their homes with explosives if you can."
On Saturday, three judges were shot dead in the northern Sinai city of al-Arish -- the same day that a court in Cairo sought the death sentence against Morsi and 106 supporters of his now outlawed Muslim Brotherhood.
"The threat to judges is real. It is a message of intimidation to the judiciary, just as they shoot at any member of the army or police," said Adly Hussein, the former head of the Cairo criminal court.
Although the judiciary says it is independent of the government and military, some of Egypt's judges have drawn accusations of blatant bias by handing down lengthy jail terms and mass death sentences against Islamists.
While supportive of Sisi, Western governments have been critical of some court decisions over the past two years, and were swift to condemn the death sentence against Morsi over his alleged role in a mass jail break before he took office.
"(It is) unjust and undermines confidence in the rule of law," the US State Department said Monday.
Islamist foes of Sisi reacted with considerably more fury.
"Getting rid of the military judges and killing them is a Shariah duty and a human necessity and a revolutionary desire," Akram Kassab, a member of the well-known Egyptian preacher Youssef al-Qaradawi's International Union of Muslim Scholars, wrote on his Facebook page after the Morsi verdict.
Neither Qaradawi nor Kassab live in Egypt and such open dissent within the country would be a one-way ticket to many years in prison.
Mass verdicts after sometimes only brief hearings have made it harder for Egypt to show it is committed to democracy four years after an uprising toppled autocrat Hosni Mubarak.
Reuters spoke to several judges who say they are following their "sacred duty" and will not be deterred by the attacks.
Still, some are taking extra precautions, such as buying weapons or having bodyguards assigned to them.
Motaz Mostafa Khafagy, head of the Giza Criminal Court on the outskirts of Cairo, survived an apparent assassination attempt this month when three bombs planted near his home were remotely detonated.
The Interior Ministry said Monday that security forces had shot dead in a gunfight two men in their early 30s who were blamed for planting the bombs.
Khafagy has ruled in several prominent security related cases, including sentencing 12 suspected Islamists to death for anti-state violence in Kerdasa district near Cairo that left a police general dead in the summer of 2013.
He has also sentenced Mohamed Badie, the leader of the Muslim Brotherhood, to 25 years in jail. Badie has received the death sentence and four life terms in a string of other cases.
These "terrorist attacks", Khafagy told Reuters, "won't scare us for a second and no judge will budge an inch from relaying his message or step down from presiding over a case".
Khalid al-Mahgoub, the judge who ordered a re-investigation into accusations that Morsi organised a jail breakout during the 2011 uprising that toppled Mubarak, has called for heavier protection for judges, prosecutors, court staff and witnesses.
"I was not scared the day I delivered my sentence in the case of the Wadi Natroun prison escape. I delivered this verdict after I studied the case files well and heard several witnesses in secret sessions for their safety, and realised there was a conspiracy in the country," said Mahgoub, who now works in public prosecutor's office.
A bomb exploded outside his home in January. Another judge had his car burnt by unknown assailants in the province of Minya, south of Cairo, security officials said.
Call for protection
Egyptian law prohibits judges from engaging in politics, but critics and human rights groups say the judicial disciplinary court has turned a blind eye to those who openly support Sisi.
By contrast, the disciplinary court ordered 41 judges into compulsory retirement earlier this year for backing the Muslim Brotherhood, judicial sources said.
The courts have also handed down lengthy jail sentences to liberal and secular activists, while gradually absolving officials close to the deposed Mubarak.
Hamdi Abdel Tawab, a board member of the Judges Club, an influential body representing judges across Egypt, called on the Interior Ministry to offer the judiciary better protection.
"There are some courts that only have two policemen guarding it," he told Reuters.
While security is usually heavier at hearings that include senior Brotherhood figures, in general, it is not difficult for anyone to attend a court session.
"We are there on the podium and we will fight terrorism with law because we are men of law," said Tawab.
Hussein, the former head of the Cairo Criminal Court, said the state could not feasibly provide special protection for "the roughly 17,000 judges and prosecutors, their homes, movements, children and wives".
But some of his colleagues have started acquiring weapons from Egypt's military production ministry, he said.
Egyptian media circulated a Facebook picture of one criminal court judge, Mohammed Yosri, posing with a gun.