The agencies "successfully dismantled a (CIA) spy network," the head of counter-intelligence at the Iranian intelligence ministry, whose identity was not revealed, told reporters in Tehran.
"Those who deliberately betrayed the country were handed to the judiciary... some were sentenced to death and some to long-term imprisonment."
The announcement comes as Iran-US tensions soar after the United States withdrew unilaterally from a landmark 2015 nuclear deal and reimposed economic sanctions on the Islamic republic.
The suspects had been "employed at sensitive and crucial centres and also the private sector related to them, working as contractors or consultants," said the official.
Seventeen suspects had been identified, all of them Iranians who had acted independently of each other, he said.
Some of them had been recruited by falling into a "visa trap" set by the US Central Intelligence Agency for Iranians seeking to travel to the United States.
"Some were approached when they were applying for a visa, while others had visas from before and were pressured by the CIA in order to renew them," said the counter-intelligence chief.
Iran said last month that it dismantled a spy network linked to the CIA.
"Following clues in the American intelligence services, we recently found the new recruits Americans had hired and dismantled a new network," state news agency IRNA reported at the time, quoting an intelligence ministry official.
IRNA said the Islamic republic had carried out the operation in cooperation with "foreign allies", without naming any state.