An Iranian-born Canadian resident has escaped to return to Canada after being detained in Iran for 11 years.

Saeed Malekpour, a web programmer from Victoria who had permanent resident status in Canada, was arrested in Iran in 2008 and accused of setting up a website that was used to post pornography. Malekpour maintained his innocence and said he was tortured in prison to force a confession to crimes against Islam.

He was sentenced to death in 2010.

Payam Akhavan, an expert in international law at McGill University and a former United Nations prosecutor who has been involved in the case for years, said that the Iranian government released Malekpour on furlough a few days ago after coming under intense pressure.

Malekpour then escaped Iran through a third country that is not being revealed. He is now in Vancouver.

'It was dangerous'

Akhavan said that no one in Iran, including his family members and lawyer, was aware of Malekpour's plan to leave the country.

"It was far from certain that the plan to bring him to Canada would succeed. So we are all very relieved," Akhavan said in a phone interview.

"It was dangerous. Really, until he set foot in Canada we were not sure that everything would go according to plan."

"[He is] once again living as a free man."

The news of his release first broke on Friday, when Malekpour's sister, Maryam, who has long advocated for his release, tweeted that he had landed in Canada.

"The nightmare is finally over!" she wrote. "Together we prevailed."

Akhavan, who witnessed the reunion between Maryam and her brother after more than a decade apart, said it was "a beautiful sight to behold, but also heartbreaking."

"To think that this innocent man who was just 33 years old when he was arrested ... has lost a decade of his life."

Breaking: My brother Saeed Malekpour has just arrived to Canada! The nightmare is finally over! Thank you Canada for your leadership. And thank you to every single person who supported us throughout this time.Together we prevailed. ✌ <a href="https://t.co/NyfiU65yQ9">pic.twitter.com/NyfiU65yQ9</a> —@FreeSaeedM

In a written statement, a spokesperson for Global Affairs wrote that "Canada welcomes the news that Saeed Malekpour has been reunited with his family in Canada. We have advocated for Mr. Malekpour's release and are pleased that he is now in Canada."

Global Affairs declined to comment further on the case, citing privacy concerns.

Akhavan said the Canadian government was "exceptionally helpful" in the case, and provided Malekpour with the proper paperwork to re-enter the country after over a decade away.

According to a written statement from Amnesty International written prior to his release, Malekpour had travelled to Iran in 2008 to visit his ailing father.

While detained, Malekpour reported that he was blindfolded, handcuffed and beaten in order to force a confession.

In February 2018, Iranian-Canadian academic and environmental activist Kavous Seyed-Emami died in an Iranian prison.

In 2003 Iranian-Canadian photojournalist Zahra Kazemi died under suspicious circumstances while in custody in Iran.