Egypt's public prosecutor has been injured after a car bomb struck his convoy as it was leaving his home in Cairo, in a high-profile attack against the judiciary, security and judicial.

Initial reports said a car bomber had rammed into the convoy of Hisham Barakat but later security sources said the car bomb apparently was detonated remotely. Two civilians and two policemen were also wounded.

Judges and other officials have increasingly been targeted by Islamist militants opposed to President Abdel Fattah al-Sisi and apparently angered by hefty prison sentences imposed on members of the now-outlawed Muslim Brotherhood.

Last month, Islamic State's Egypt affiliate urged followers to attack judges, opening a new front in an Islamist insurgency in the world's most populous Arab state. Earlier in the same month, three judges were shot dead in the northern Sinai city of al-Arish.

Assistant public prosecutor Zakariya Abdel Aziz said the attack was an assassination attempt against Mr Barakat. The bomb exploded as he left his home in the neighbourhood of Heliopolis for his office.

Health ministry spokesman Hossam Abdel Ghaffar said Mr Barakat had suffered a dislocated shoulder and a deep cut and may have fractured his nose. He was in stable condition and was currently in a recovery room after surgery, Abdel Ghaffar said.

Eyewitnesses said the explosion was strong enough to shatter glass in nearby storefronts and homes. A large plume of black smoke and several smouldering cars were seen near apartment buildings.

Mr Barakat's place of work was also targeted earlier this year when a bomb exploded near the High Court in central Cairo, killing two people.

Egypt is facing a Sinai-based insurgency that has killed hundreds of policemen and soldiers since the army toppled Islamist President Mohamed Morsi after mass protests against his rule in 2013.

The most active group is Sinai Province, which has pledged allegiance to Islamic State, the group that has taken control of large parts of Iraq and Syria.

A video titled Eliminating the Judges was published by the group's media arm on Sunday, which showed gunmen opening fire on a vehicle they said was carrying judges.

Justice Minister Ahmed el-Zind, who is seen as a hardline judge and outspoken in his criticism of the Brotherhood, said the attack would not deter Egypt's judge and public prosecutors from carrying out their "their patriotic duty that the constitution entrusts them to do in going after terrorist elements and other criminals."

The judiciary says it is independent of the government and military. But some of Egypt's judges have drawn accusations of blatant bias by handing down lengthy jail terms and mass death sentences against Islamists.

A Cairo court sentenced Morsi to death in June over a case related to a 2011 mass jail break.