Three young Americans who have been detained in Iran since July have been formally charged with spying, according to reports.

iran-americans-cp-7626588

This undated photo shows Shane Bauer and Sarah Shourd. The two are among three Americans charged with spying in Iran. ((freethehikers.org/Associated Press))

"The three are charged with espionage. Investigations continue into the three detained Americans in Iran," Tehran general prosecutor Abbas Jafari Dolatabadi said, according to Reuters.

Families of Shane Bauer, Sarah Shourd and Josh Fattal, all graduates of the University of California at Berkeley, say they were hiking in northern Iraq when they accidentally strayed over the Iranian border.

Iranian President Mahmoud Ahmadinejad told reporters in Istanbul, Turkey, that he had no opinion about the case.

"It must be judged by the judiciary, whether they are spies or not," he said. "There are some Iranians who have spent many years in prison without doing anything wrong. ...."

He said the Americans had crossed the border illegally and Iran has a right to punish them.

"In all countries, crossing borders would have a very heavy sentence, according to the law," he said. "Hopefully, they will have an appropriate answer in the court, and hopefully they will convince the judge that they did not have any intention of crossing the border illegally."

U.S. Secretary of State Hillary Rodham Clinton called for their release.

"We believe strongly that there is no evidence to support any charge whatsoever," Clinton told reporters in Berlin. "And we would renew our request on behalf of these three young people and their families that the Iranian government exercise compassion and release them, so they can return home."

Clinton said the U.S. would continue to make that case through Swiss channels that represent American interests in Tehran.

iran-american-cp-7626584

This image made from a July 29, 2009, video shows Josh Fattal, also charged with spying, in the Kurdish city of Irbil, Iraq. ((Shon Meckfessel/Associated Press))

The timing of the announcement of charges raised the possibility that Tehran was using the case to pressure the United States amid negotiations over Iran's nuclear program.

Iran is also holding another American, academic Kian Tajbakhsh, who was arrested amid Iran's postelection turmoil and was sentenced last month to 12 years in prison for an alleged role in opposition protests.

Last month, Iranian-Canadian journalist Maziar Bahari was freed from jail in Tehran after being held for four months on accusations of spying.

In January, Iranian-American journalist Roxana Saberi was arrested in Tehran, was convicted of espionage, then released on appeal in May. Two months later, U.S. forces in Iraq freed five Iranians they had been holding for months.

With files from The Associated Press