The convicts are identified as Yousef Mehrdad and Sadrollah Fazeli Zare.
The judiciary said the former led groups active on social media that focused on anti-Islam activities and engaged in blatant insults to sanctities.
According to the judiciary both convicts had links in France.
The judiciary said they had also insulted Islam’s Prophet Mohammad and members of his infallible household.