Iran's supreme court has upheld the death sentence for a web programmer who faces imminent execution after being found guilty of developing and promoting porn websites.

Saeed Malekpour was picked up by plainclothes officers in October 2008 and taken to Evin prison in Tehran, where he spent a year in solitary confinement without access to lawyers and without charge.

A year after his arrest, the 35-year-old appeared in a state television programme confessing to a series of crimes in connection with a porn website. On the basis of his TV confessions, he was convicted of designing and moderating adult materials online by a court in Tehran, which handed down death penalty.

Malekpour later retracted his confessions in a letter sent from prison, in which he said they had been made under duress.

According to Malekpour's family, he is a permanent resident of Canada and is a programmer who wrote photo-uploading software that was used by a porn website without his knowledge.

His sister, Maryam Malekpour, said the supreme court had confirmed the death sentence despite many discrepancies in the case. "Saeed's lawyers were told that his death sentence will be issued this week," she said in an interview with the Iranian website Roozonline.

After an international campaign and new expert evidence, the supreme court suspended Malekpour's death sentence in June 2011 and ordered a judicial review.

Speaking to the Guardian, Maryam Nayeb Yazdi, a human rights activist based in Toronto who has followed Malekpour's case closely, said: "Saeed is in imminent danger of execution. He has never been provided with a fair trial at any point during this horrific and twisted ordeal.

"There are various discrepancies in Saeed's case file that were supposed to be reviewed and investigated by the revolutionary court, but the judge ignored the discrepancies and reissued the death sentence anyway.

"Saeed is being used as a scapegoat in a string of political games led by the revolutionary guards."

In his letter, Malekpour said large proportions of his confessions had been "extracted under pressure, physical and psychological torture" and in the face of threats to him and his family.

"Once, in October 2008, the interrogators stripped me while I was blindfolded and threatened to rape me with a bottle of water," he wrote. "While I remained blindfolded and handcuffed, several individuals armed with cables, batons, and their fists struck and punched me. At times, they would flog my head and neck.

"Such mistreatment was aimed at forcing me to write what the interrogators were dictating, and to compel me to play a role in front of the camera based on their scenarios."

Drewery Dyke, of Amnesty International, said: "The death sentence recently upheld in the case of Saeed Malekpour extends the long, cold reach of execution in Iran.

"He is alleged to have created 'pornographic' internet sites and [is accused of] 'insulting the sanctity of Islam', for which he was charged with 'spreading corruption on earth', a vaguely worded charge which attracted the death penalty in Iran.

"The use of vaguely worded charges is not new in Iran, but the allegation that these were carried out on the internet is. It is an unwelcome addition to the catalogue of ways in which Iran finds it can execute its own citizens.

"In advance of March's parliamentary elections, when you would expect the right to exercise one's freedom of expression to increase, this case exemplifies 'innovative' ways as to how Iran is setting itself against access to online information."

Iran has faced international criticism for escalating its use of the capital punishment in recent years. In December, Amnesty warned against "a killing spree of staggering proportions" in the Islamic republic, and said Iran had executed at least 600 people between the beginning of 2011 and the end of November.