At about the same time that Hezbollah was identifying the CIA network in Lebanon, Iranian intelligence agents discovered a secret internet communication method used by CIA-paid assets in Iran.
The CIA has yet to determine precisely how many of its assets were compromised in Iran, but the number could be in the dozens, according to one current and one former U.S. intelligence official.
The exposure of the two spy networks was first announced in widely ignored televised statements by Iranian and Hezbollah leaders. U.S. officials tell ABC News that much of what was broadcast was, in fact, true.
Hezbollah's leader, Sayyed Hasan Nasrallah, announced in June of this year that two high-ranking members of Hezbollah had been exposed as CIA spies, leading U.S. officials to conclude that the entire network inside Hezbollah had been compromised.
In Iran, intelligence minister Heidar Moslehi announced in May that more than 30 U.S. and Israeli spies had been discovered and an Iranian television program, which acts as a front for Iran's government, showed images of internet sites used by the U.S. for secret communication with the spies.
U.S. officials said the Iranian television program showed pictures of people who were not U.S. assets, but the program's video of the websites used by the CIA was accurate.
Some former U.S. intelligence officials say the developments are the result of a lack of professionalism in the U.S. intelligence community.
"We've lost the tradition of espionage," said one former official who still consults for the U.S. intelligence community. "Officers take short cuts and no one is held accountable," he said.
But at the CIA, officials say such risks come with the territory.
"Hezbollah is an extremely complicated enemy," said a U.S. official. "It's a determined terrorist group, a powerful political player, a mighty military and an accomplished intelligence operation, formidable and ruthless. No one underestimates its capabilities."
"If you lose an asset, one source, that's normally a setback in espionage," said Robert Baer, who was considered an expert on Hezbollah.
"But when you lose your entire station, either in Tehran or Beirut, that's a catastrophe, that just shouldn't be. And the only way that ever happens is when you're mishandling sources."