"These two defendants who came to Tabriz in cooperation with hostile groups based abroad are currently detained and have admitted to having committed an offence," Gholam Hossein Mohseni Ejeie told state IRNA news agency.
In a separate report, Ejeie said the pair entered Iran on tourist visas and identified themselves as journalists without any proof before contacting the family of Sakineh Mohammadi-Ashtiani, who faces death by stoning.
"They recognised that it was an offence to pass oneself off wrongly as a journalist," the Fars news agency quoted him as saying.
German Foreign Minister Guido Westerwelle said on Tuesday that the two detainees were Germans, and that his government was doing all it could to secure their release.
"We are working on all diplomatic levels and using all diplomatic channels to pursue the freeing of these two Germans and returning them to Germany as soon as possible," Westerwelle said.
On Friday, the German government said diplomats still had no direct contact with the arrested, and declined to comment on the reports they have confessed.
A foreign ministry spokesman told reporters in Berlin that efforts were continuing to secure their release.
Ashtiani was sentenced to death by two different courts in the northwestern city of Tabriz in separate trials in 2006.
The first death sentence, by hanging, for her involvement in the murder of her husband, was commuted to a 10-year jail term by an appeals court in 2007.
But the second, by stoning, was on a charge of adultery levelled over several relationships, notably with the man convicted of her husband's murder, and was upheld by another appeals court the same year.
Since July, Iranian officials have said repeatedly that the stoning sentence has been stayed in the face of international outcry.