Two men associated with the Islamic State were arrested in India for allegedly planning to attack a local synagogue.

The anti-terrorism squad in the western Indian state of Gujarat arrested the men, residents of the port city of Surat, on Wednesday. They are accused of planning to attack the synagogue in the Khadia area of Ahemdabad, the largest city in Gujarat.

The suspects did reconnaissance on the Magen Abraham synagogue on Sept. 12 and were planning either an explosion or shooting there, the Times of India reported. The men allegedly are ISIS operatives and reportedly had been in touch with an Indian ISIS handler based in Afghanistan.

One of the men was arrested at his workplace and the other at his home, according to the report. Law enforcement seized cellphones, laptops and other electronic devices from both locations.

The state anti-terrorism squad told the newspaper that the two men had been on their radar for some time and were taken into custody as they were preparing to carry out the attack. The men had planned to escape to Syria via Jamaica following the attack in order to join ISIS, anti-terrorism officials told the newspaper.

The men reportedly were trying to radicalise youths in India via social media and meetings.