The acquittal of Pastor Yousef Naderkhani in a re-trial in Iran's northern Gilan province demonstrates just why the Iranian authorities must guarantee the rights of all religious minorities in Iran, Amnesty International said.
"We welcome the acquittal of Yousef Naderkhani but he should have never been arrested, let alone charged and tried," said Ann Harrison, Amnesty International's Deputy Director for the Middle East and North Africa.
"His arrest on 13 October 2009 in connection with his objection to an educational requirement that all children learn the Qur'an - which he considered to be unconstitutional - should not have led to almost three years of imprisonment.
"His trial at the end of September 2011 on the charge of apostasy - which is not even an offence in Iran's current Penal Code - put the lie to Iran's claims that it tolerates religious minorities," she added.
Under Article 167 of Iran's Constitution, judges are required to use "authoritative Islamic sources and authentic fatwas" to rule on matters not covered by Iranian legislation.
International human rights law prohibits this practice and requires prosecutions to be on the basis of codified criminal law only.
Naderkhani was initially charged in connection with his objection, while further charges relating to his alleged apostasy and evangelism were brought later.
He was sentenced to death in 2010 following a grossly flawed trial in a local court in the north of Iran.
Iran's Supreme Court upheld the verdict in September 2011, but instructed the lower court charged with implementing the verdict to ensure that his conversion to Christianity was a decision taken when, under Iranian law, he could have been considered an adult.
The Supreme Court required also that the lower court should give him an adequate opportunity to 'repent' in line with procedures set out in Islamic law.
Yousef Naderkhani, who was born to Muslim parents in the northern Iranian town of Rasht, adopted Christianity at the age of 19.
He became a member of a Protestant Church before being ordained as a pastor in Rasht. He says he was never a practising Muslim.
Under Iran's Constitution Shi'a Islam is the country's official religion, while Christians, Jews and Zoroastrians are the only recognized religious minorities.
Members of unrecognized religious minorities face severe restrictions on their ability to practise their religions which in the case of the Baha'i community amounts to persecution.
But despite belonging to a recognized religion, Christians who have converted from Islam are at risk being accused of apostasy, which can carry the death penalty under Islamic law, while those who evangelise are harassed and sometimes arrested and prosecuted under national security laws.
Naderkhani refused to recant his beliefs during the September 2011 Supreme Court hearing, reportedly telling the judge: "I am resolute in my faith and Christianity and have no wish to recant."
In the latter part of 2011, judicial officials in Gilan reportedly sought guidance from Iran's Supreme Leader about how to deal with the case.
In the first half of 2012, the authorities signalled that a new trial would be held.
"Yousef Naderkhani's acquittal and release shows that the Iranian authorities finally recognized that there was no way they could justify his trial and carry out his death sentence which had rightly caused an international outcry," said Harrison.
"They must learn the lesson and ensure that the new Penal Code, passed by parliament in February 2012, which has not yet passed into law, fully protects freedom of religion and belief.
"All minorities in Iran must be allowed to enjoy their rights - individually, and with their communities."
Yousef Naderkhan was sentenced to three years' imprisonment but was released as he had already served the time and has now reportedly rejoined his family.