Iran has freed two Chinese citizens detained for allegedly taking photos of Iranian military facilities, China's foreign ministry has said.
The ministry said the two were arrested last month during survey work they were carrying out for property owners.
According to a Chinese statement the incident had been a misunderstanding.
Last year, Iran sentenced two Swedish men to two years in prison for taking pictures of military facilities. They were released early, in April.
The Chinese foreign ministry said: "In early July, two people from Chinese companies mistakenly took some pictures of some sensitive buildings when they were helping local owners to conduct field measurements in Iran.
"They were detained by Iranian police and now they have been freed. The foreign ministry and Chinese embassy in Iran have warned Chinese citizens in Iran to behave so as to prevent misunderstandings."
Iranian officials said earlier this month that the Chinese nationals had taken photographs of a military complex in the town of Arak, in central Iran, and accused them of spying.
Tehran is building a controversial nuclear reactor near the town. The two had entered Iran via the beach resort of Kish island which lies off Iran's southern coast, the officials said.
Correspondents say this is the first time Chinese citizens have been accused of spying in Iran.
The two countries have good relations, and China has secured involvement in large oil deals in the country.
However, Beijing has backed two rounds of UN Security Council sanctions designed to make it harder for Iran to pursue its nuclear programme.