(CNN) -- Two German journalists have been released from prison after being charged with espionage in Iran for interviewing the son and lawyer of a woman condemned to die by stoning, a spokesman for Germany's Foreign Ministry confirmed Saturday.

Both men were in the northwestern city of Tabriz, accompanied by German consular officials, the spokesman said. The officials hoped to bring them to the German Embassy in Tehran later in the day, though no other details were given.

Marcus Hellwig and Jens Koch had been sentenced to 20 months in prison. But Iran's Revolution Court dismissed the sentences, instead slapping each with $50,000 fines, Iran's state-run Press TV said.

The two men were arrested in October after they interviewed the son and lawyer of Sakineh Mohammadi Ashtiani, who was convicted of adultery in 2006 and sentenced to death by stoning.

"Their reports and propaganda in Tabriz proved that they are in the country for spying," Malek Ajdar Shafiee, the head of the Justice Department of East Azarbaijan, was quoted as saying by Iran's semi-official Fars News Agency.