According to Reuters news agency, Shane Bauer and Josh Fattal were arrested on July 31, 2009 near Iran's border with Iraq, along with a third American, Sarah Shourd, who was freed on $500,000 bail in September 2010 and returned home.
The trio, in their late 20s and early 30s, say they were hiking in the mountains of northern Iraq and, if they crossed the unmarked border into Iran, it was by mistake.
"Josh and Shane were informed about the verdict on Saturday," lawyer Masoud Shafiee told Reuters, adding that he had not seen them in person. The two years they had already served would count toward their 8-year sentences, he said.
Confirming a leaked report of the sentence, Tehran Prosecutor-General Abbas Jafari Dolatabadi told a news conference that no verdict had yet been passed on Shourd who did not return to Iran to stand trial.
Several prominent public figures including boxer Muhammad Ali and singer Yusuf Islam, both Western converts to the Muslim faith, have called for their release.
Musician and humanitiarian Yusuf Islam is formerly known as Cat Stevens, who was refused entry to the United States in 2004 for alleged ties to Islamic extremism.