A pioneering Iranian-Canadian blogger serving a 19-year jail term in Iran has been released and pardoned by the country鈥檚 leader.

Hossein Derakhshan, who helped spark Iran鈥檚 blogging revolution under the screen name 鈥渢he Blogfather,鈥 announced in a social media post on Thursday that he has been pardoned by Iran鈥檚 Supreme Leader, Ayatollah Ali Khamenei.

鈥淚 was released after six years,鈥 Derakhshan said in a translated Google Plus post on Thursday. 鈥淭hank you God. I am very grateful to the Ayatollah Khamenei.鈥

Derakhshan is credited with kick-starting Iran鈥檚 blogging revolution by publishing instructions written in Farsi on how to start a blog.

He was jailed in 2008 and sentenced to 19-and-a-half years in prison in 2010 on charges of spreading propaganda against the government, insulting Islamic thoughts and religious figures, co-operating with hostile countries and promoting counter-revolutionary groups. His sentence was later reduced to 17 years.

Born and raised in Iran, Derakhshan worked as a journalist in the capital of Tehran before moving to Canada to attend the University of Toronto in 2000. While in Toronto, Derkhshan became a Canadian citizen and began criticizing Iran鈥檚 clerical leadership, headed by the Ayatollah. Derakhshan also travelled to Israel in 2006, where he was allowed entry due to his Canadian citizenship.

Iranians are not permitted to travel to Israel, as Iran has refused to recognize Israel as a country.

Derakhshan鈥檚 case was complicated by his dual citizenship, which Iran does not recognize.

His former website, Hoder.com, expired during his prison term.