Updated

TEHRAN, Iran -- Two American men arrested more than two years ago while hiking along the Iraq-Iran border have been sentenced to eight years in prison on charges that include espionage, state TV reported Saturday, in an apparent sharp blow to hopes their release was imminent.

The announcement seems to send a hard-line message from Iran's judiciary -- which answers directly to the ruling clerics -- weeks after the country's foreign minister suggested that the trial of Shane Bauer and Josh Fattal could clear the way for their freedom.

It also is likely to raise speculation about Iran using the Americans as political bargaining chips and could bring added tensions to Iranian President Mahmoud Ahmadinejad's expected visit to New York next month for the annual General Assembly at the United Nations.

But the report -- although carried on Iran's highly controlled state media -- was not immediately confirmed by authorities. Iranian government officials made no further comment, but it is not unusual for Iran to use selected state news outlets to make high-profile announcements.

In Washington, State Department Spokeswoman Victoria Nuland restated U.S. appeals for their release. "It is time to reunite them with their families," she said.

The Americans, whose final court hearing was three weeks ago, deny the charges and say they were only hiking in a scenic and largely peaceful area of northern Iraq near the porous border.

They were detained in July 2009 along with a third American, Sarah Shourd, who was released in September 2010 on $500,000 bail and returned to the United States. Shourd's case "is still open," the state-run TV website irinn.ir reported.

Bauer and Fattal, both 29, have been sentenced to three years each for illegal entry into Iran and five years each for spying for the United States, the website quoted "informed sources" at Iran's judiciary as saying. It was not immediately clear if that includes time served. They have 20 days to appeal the sentence.

Their Iranian attorney, Masoud Shafiei, said he has not been notified of the verdict but he will definitely appeal the sentence if true.

"I've not been notified of any verdict in the case of my clients," Shafiei told The Associated Press. "This is a strong verdict inconsistent with the charges."

It's unclear what maximum sentence was possible by the Revolutionary Court, which handles state security issues. Espionage can bring the death penalty, but handing the sentence to a foreigner is unknown legal territory in Iran.

Iran insists that its judiciary is independent from political currents, but Iranian officials have used the detained Americans to draw attention to alleged mistreatment of Iranians in U.S. prisons and others who were held by U.S. forces in Iraq. The report on the sentences came just two days after President Barack Obama made his most direct call for the resignation of Syrian President Bashar Assad, who remains among Iran's closest Mideast allies.

The case, meanwhile, has added to tensions between the United States and Iran that were already high over other issues, including Tehran's disputed nuclear program.

But Iran also recognizes the potential for goodwill gestures. Shourd's release -- assisting with talks by Oman -- came last year as Ahmadinejad was preparing for the annual U.N. gathering of world leaders.

The Americans say they mistakenly crossed into Iran when they stepped off a dirt road while hiking near a waterfall in the Kurdish region of Iraq. While other parts of Iraq remain troubled by violence, the semiautonomous Kurdish north has drawn tourists in recent years, including foreigners.

The U.S. government has appealed for the two men to be released, insisting that they have done nothing wrong. The two countries have no direct diplomatic relations, so Washington has been relying on an interests section at the Swiss Embassy in Tehran to follow the case.

Earlier this month, Foreign Minister Ali Akbar Salehi said he hoped "the trial of the two American defendants who were detained for the crime of illegally entering Iran will finally lead to their freedom." Their lawyer also had expressed hope they might receive a pardon for the Islamic holy month of Ramadan.

Phone and email messages left for Sarah Shourd, relatives of the two men and the families' spokeswoman Samantha Topping were not immediately returned.

Shourd is back living in Oakland, California; Bauer grew up in Onamia, Minnesota; and Fattal is from suburban Philadelphia. The last direct contact family members had with Bauer and Fattal was in May 2010 when their mothers were permitted a short visit in Tehran.

Their case most closely parallels that of freelance journalist Roxana Saberi, an Iranian-American who convicted of spying before being released in May 2009. Saberi was sentenced to eight years in prison, but an appeals court reduced that to a two-year suspended sentence and let her return to the U.S.

At the time, a spokesman for the Iranian judiciary said the court ordered the reduction as a gesture of "Islamic mercy" because Saberi had cooperated with authorities and expressed regret.

In May 2009, a French academic, Clotilde Reiss, also was freed after her 10-year sentence on espionage-related charges was commuted.

Last year, Iran freed an Iranian-American businessman, Reza Taghavi, was held for 29 months for alleged links to a bombing in the southern city of Shiraz, which killed 14 people. Taghavi denied any role in the attack.