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

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

“I was released after six years,” Derakhshan said in a translated Google Plus post on Thursday. “Thank you God. I am very grateful to the Ayatollah Khamenei.”

Derakhshan is credited with kick-starting Iran’s 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’s 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’s case was complicated by his dual citizenship, which Iran does not recognize.

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