While the ATS had sought a 14-day custody of Mohammad Kasim Stimberwala and Ubed Ahmed Mirza, Chief Judicial Magistrate R D Mehta granted it custody till November 6.
ATS officials held Stimberwala from Ankleshwar while Mirza was arrested from Surat yesterday.
They are accused of conspiring to spread terror in Gujarat and rest of the country through 'lone wolf' attacks.
They have been booked under IPC sections 120-b (criminal conspiracy), 121-a (waging war against government of India) and 125 (waging war against any Asiatic power in alliance with government of India).
More From This Section
In the FIR, the ATS alleged that the duo were planning to attack a synagogue in Khadia area of Ahmedabad.
While Stimberwala worked as a laboratory technician at a hospital in Ankleshwar, Mirza, a lawyer, practised in the Surat district court. He also owns a hotel in Surat.
Both are "highly radicalised by the fundamentalist ideology of the Islamic State (ISIS) for last many years and (were) actively planning to cause terrorist acts", the ATS said in the FIR.
They were influenced by Abdullah el-Faisal, a radical preacher deported from the UK to Jamaica. Recently, el-Faisal was detained in Jamaica on the charges of urging youths to travel to Syria and take part in 'jihad', said the FIR.
Monitoring of their social media accounts revealed that Stimberwala and Mirza were attracted to the extremist ideology for the last three-four years, said the FIR.
Both were making "intensive efforts to radicalise other youths in India", the ATS said.