Khodai was "one of the defenders of the shrines", the semi-official Tasnim news agency reported, referring to military personnel or advisers who Iran says fight on its behalf to protect Shi'ite sites in Iraq or Syria against groups such as Islamic State.
Two people on a motorcycle opened fire on Khodai, Tasnim reported, citing an informed source, while the semi-official ISNA news agency reported that members of an Israeli intelligence service network had been discovered and arrested by the Guards.
The Israeli Prime Minister's Office, which oversees intelligence agency Mossad, declined to comment on the events in Tehran.
"The sworn enemies of the holy system of the Islamic Republic of Iran once again showed their evil nature with the assassination and martyrdom of one of the members of the IRGC troops," said Iranian Foreign Ministry spokesperson Saeed Khatibzadeh.
At least six Iranian scientists and academics have been killed or attacked since 2010, several of them by assailants riding motorcycles, in incidents believed to have targeted Iran's disputed nuclear programme, which the West says is aimed at producing a bomb.
Iran denies this, saying its nuclear programme has peaceful purposes, and has denounced the killings as acts of terrorism carried out by Western intelligence agencies and the Mossad. Israel has declined comment on such accusations.
In April, Iran's intelligence ministry said it had arrested three Mossad spies in a statement published by the semi-official Fars news agency.
Iran has been sending fighters to Syria since the early stages of its civil war to support its ally, President Bashar al-Assad, against Sunni rebels.
The "defenders of the shrines" also include Afghan and Pakistani volunteers.
(Reporting by Dubai Newsroom; writing by Michael Georgy; editing by Frances Kerry and Jason Neely)