TEHRAN  Iran has arrested an unspecified number of “nuclear spies” in connection with a damaging worm that has infected computers in its nuclear program, the intelligence minister, Heydar Moslehi, said Saturday.

Mr. Moslehi also told the semiofficial Mehr news agency that the ministry had achieved “complete mastery” over government computer systems and was able to counter any cyberattacks by “enemy spy services.”

Iran confirmed last week that the Stuxnet worm, a malicious self-replicating program that attacks computers that control industrial plants, had infected computers in its nuclear operations. Officials said it had been found in personal computers at the Bushehr nuclear plant, a power generator that is not believed to be part of a weapons program, and that it had not caused “serious damage” to government systems.

While the origins of the worm remain obscure, many computer security experts believe it was created by a government with the intent of sabotaging Iran’s nuclear program, which Western countries believe is aimed at creating a nuclear weapon. The United States and Israel have cyberwarfare programs and both countries have sought to undermine Iran’s nuclear enrichment program, but neither has commented on the Stuxnet worm.