The two, identified as Mohammad Masoum Shahi and Hamed Validi, were accused of belonging to a spy network linked to Mossad and had received training abroad, including in Iraq’s Kurdistan region