The news of the pardon of Hossein Derakhshan, who helped ignite blogging in Iran, was first reported by Iran's semi-official ISNA news agency. It said authorities informed Derakhshan about his amnesty late Wednesday, when he returned to Tehran's Evin prison from one of his occasional leaves.
"I was released after six years," said a brief message posted on Derakhshan's Google Plus web page. "I thank God. Very grateful to the Ayatollah Khamenei."
The posting also thanked his supporters and his family, including his parents, his brother and sister and his wife.
The ISNA report did not elaborate on the reason for Derakhshan's pardon by Khamenei, who has final say on all state matters. However in the past, Derakhshan's parents have reportedly sent letters to Khamenei seeking their son's pardon.
Derakhshan moved to Canada in 2000 and studied sociology at the University of Toronto.
Derakhshan, the founder of one of the first Farsi-language blogs, was first detained in 2008. In 2010, a court sentenced him to more than 19 1/2 years in prison for his writings. The term was later dropped to 17 years.
Derakhshan, now 39, helped ignite blogging in Iran by posting online simple instructions on how to create sites in Farsi in 2001. The subsequent flourishing of blogs by Iranians at home and abroad gave the country's reform movement a crucial online platform.
Writing from Canada, Derakhshan was initially a critic of Iran's clerical leadership. Using his Canadian passport, he visited Israel, Iran's archenemy, in 2006 saying he wanted to act as a bridge between the two peoples.
Derakhshan was convicted on charges of co-operation with hostile countries — a reference to the Israel visit — spreading propaganda against the ruling establishment, promotion of counter-revolutionary groups and insulting Islamic thought and religious figures.
But he later became a vocal supporter of former hardline President Mahmoud Ahmadinejad, praising him for standing up to the West and criticizing regime opponents.
--With files from The Canadian PressSuggest a correction