Those released from prison include some arrested in recent anti-government protests.
The pardons approved on Sunday by Ayatollah Ali Khamenei came with conditions, according to details announced in state media reports, which said the move would not apply to any of the numerous dual nationals held in Iran.
Those accused of “corruption on earth” – a capital charge brought against some protesters, four of whom have been executed – would also not be pardoned, state news agency IRNA reported.
Neither would it apply to those charged with “spying for foreign agencies” or those “affiliated with groups hostile to the Islamic Republic”.
Iran was swept up by protests following the death of a young Iranian Kurdish woman Mahsa Amini in the custody of the country’s morality police last September. The 22-year-old had been arrested for violating Islamic dress codes.
Iranians from all walks of life took part in the demonstrations, marking one of the boldest challenges to Iran’s government since the 1979 revolution.
‘Indoctrination and propaganda’
According to the Human Rights Activists News Agency, about 20,000 people have been arrested in connection with the protests, which the authorities accused Iran’s “foreign enemies” of fomenting.
Rights groups say more than 500 have been killed in the crackdown, including 70 minors. At least four people have been hanged, according to the Iranian judiciary. Iran has not offered a death toll for months.
In a letter to Khamenei requesting the pardon, judiciary head Gholam-Hossein Mohseni Ejei said: “During recent events, a number of people, especially young people, committed wrong actions and crimes as a result of the indoctrination and propaganda of the enemy.”
Protests have slowed considerably since the hangings began.
“Since the foreign enemies and anti-revolutionary currents’ plans have been foiled, many of these youth now regret their actions,” Ejei wrote.
Khamenei approved the pardons in honour of the anniversary of the 1979 Islamic revolution. Khamenei took on the post as the country’s political and religious leader in 1989.
The Norway-based group Iran Human Rights said last week that at least 100 detained protesters faced possible death sentences.
Amnesty International has criticised Iranian authorities for what it called “sham trials designed to intimidate those participating in the popular uprising that has rocked Iran”.