The director of Hayan Publications as well as a dissident blogger, Khazali received this sentence after more than 27 days on a hunger strike and he is in critically poor health.
Two days ago he was reportedly taken to the prison infirmary due to hemorrhaging of his digestive tract.
Khazali has been arrested on several occasions since the controversial presidential elections of 2009, which revealed a deep rift in the Islamic Republic establishment between the conservatives and the reformist factions.
His previous arrest occurred last July, and he was released on bail after a month-long hunger strike.
Khazali has used his blogposts to criticize the Mahmoud Ahmadinejad administration and denounce government policies.
He has written open letters to the Leader of the Islamic Republic Ayatollah Khamenei, warning him against the current mistreatment of the opposition and inadequacies of the system.
Khazali is the son of the conservative cleric and member of the Assembly of Experts, Abolghassem Khazali, who has disowned his son.
Mehdi Khazali, who is also a physician, was disqualified from running in the last parliamentary elections and was denied and appointment to the board of directors of Iran’s College of Physicians.