CAIRO (Reuters) - Egypt's public prosecutor has brought before the military judiciary 292 suspected Islamic State militants, some of whom are accused of plotting to assassinate President Abdel Fattah al-Sisi and Saudi Arabia's Crown Prince Mohammed bin Nayef.

The suspects are accused of belonging to 22 cells and carrying out 19 attacks in total, including the assassination of three judges who were overseeing a parliamentary election in restive northern Sinai, which borders Gaza, Israel and the Suez Canal, judicial sources and state media said.

They are accused of belonging to Sinai Province, Islamic State's Egyptian affiliate, which operates out of northern Sinai. Of the 292 suspects, 151 are in custody, seven are out on bail, and the rest on the run.

Suspects in security and terrorism-related cases are often sent to the military courts in Egypt, but human rights activists say the military judiciary is not fit to try civilians.

The investigation had been ongoing for over 18 months, state news agency MENA said, and included confessions by 66 suspects.

According to judicial sources and a presentation prepared by a state security prosecutor and reviewed by Reuters on Monday, the suspects include one cell consisting of six police officers and a dentist, who plotted to kill Sisi in Egypt by targeting his motorcades.

Another cell, based in Saudi Arabia, took advantage of one of its members working in a Mecca hotel where they mistakenly thought Sisi was staying. The ring planned for the wife of one of the members to detonate a bomb at a holy site to distract security forces while they targeted Sisi and the Saudi prince.

An Islamist insurgency in the rugged and thinly populated Sinai Peninsula has gained pace since 2013, when Sisi overthrew President Mohamed Mursi of the Muslim Brotherhood, Egypt's oldest Islamist movement, following protests against his rule.

Hundreds of soldiers and police have been killed by militants in northern Sinai. The main group staging the insurgency pledged allegiance to Islamic State in 2014 and adopted the name Sinai Province.

It was not immediately possible to contact the families or lawyers of the accused.

(Reporting by Haitham Ahmed; Writing by Ahmed Aboulenein; Editing by Larry King)