Foreign ministry spokesman Mohammad Ali Hosseini said both men would be released later on Monday.
"Within the framework of the humanitarian efforts of Iran and following the requests of the family and repeated requests from Swedish politicians... they have been pardoned and will be freed at 6:00 pm' (1530 GMT)" Ali Hosseini said in a statement.
Stefan Johanssen and Jari Hjortmar, who had been sentenced to two years in prison, were arrested in March 2006 for taking pictures of military installations on Iran's southern island of Qeshm.
Qeshm is in the Strait of Hormuz, about 1,400km south of the capital, Tehran, and near the city of Bandar Abbas.
According to Swedish media reports, the men had been working as construction workers at the time of their arrest.
Swedish officials said they wouldn't comment on the release until the men had arrived back home.
The Swedes' release comes less than two weeks after Tehran pardoned and freed 15 British sailors and marines who were detained for illegally entering Iranian waters.
Two other Europeans, German tourist Donald Klein and French boat skipper Stephane Lherbier, were also released earlier this year before completing 18-month sentences for violating Iran's territorial waters.
-- AJP and AgenciesGüncelleme Tarihi: 17 Nisan 2007, 18:49