David Shamir, a psychiatrist and officer in a reserve unit of the army's medical corps, sent e-mails and faxes to Iranian and Hamas officials saying he could provide them with classified information, according to police and the court indictment released Friday.
Shamir told interrogators after he was caught that he was motivated by "greed."
In April, the 45-year-old resident of a Tel Aviv suburb e-mailed the foreign ministry of Iran, Israel's most bitter enemy, according to the indictment. He introduced himself as a well-connected Israeli officer and said he could offer details on the army's emergency medical programs, the location of medical command centers and evacuation plans for civilians during missile attacks, the court document said.
Shamir later sent several faxes from his home to the Iranian consulates in London and Istanbul, again offering his services.
The indictment indicated that the Iranians did not accept Shamir's offer.
Shamir then turned to Hamas, sending an e-mail in early November to the Gaza Strip's Al-Azhar University, a stronghold of the Iranian-backed group that took over the coastal territory in June, saying that he wanted to "join the struggle."
Israeli law forbids contact with the Islamic organization, considered a terrorist group by Israel, the United States and European Union.
Shamir also approached the Russian intelligence agency FSB - the Federal Security Service - and expressed an interest in joining its ranks, according to the indictment.
The indictment did not say whether Hamas or the FSB replied to Shamir. The charges against the suspect include only attempted espionage, indicating that no classified information actually changed hands.
Asked by his interrogators why he wanted to help Israel's enemies, Shamir responded that it was "a kind of greed," the police statement said.
Shamir, who ran a drug rehabilitation clinic, was also found to be in possession of marijuana, police said.
"This fact surprised the investigators, in light of the fact that he is a civil servant in a government institution who as part of his job is supposed to treat suspects sent by the court for drug rehabilitation treatment," the statement said.
In addition to the charge of attempted espionage, Shamir was indicted for contact with a foreign agent and obstruction of justice. Friday's indictment did not include drug charges.
Shamir is not the first Israeli to be charged for ties with Iran and its allies.
In 1998, businessman Nahum Manbar was sentenced to 16 years in prison for supplying Iran with materials that could be used to manufacture chemical weapons.
Last year, an Israeli court convicted army colonel Omar el-Heib of spying for the Lebanese militant group Hezbollah. El-Heib was found guilty of providing the Iran-backed organization with information on Israeli troop movements in return for money and drugs, and was sent to jail for 15 years.