A young Afghan journalist has been spared execution after an appeal court overturned the death sentence handed down for his conviction for blasphemy by a provincial court earlier this year.
However, the appeal court the conviction on Tuesday and replaced the death penalty with a 20-year prison term.
Perwiz Kambakhsh was arrested one year ago in the northern city of Mazar-i-Sharif for distributing an internet article that was described as questioning central tenets of Islam and the rights of women in Islamic communities.
Kambakhsh's arrest and sentencing has drawn condemnation from both the Afghan and western media and human rights groups, leading to calls for the president, Hamid Karzai to intervene.
The primary court in the northern province of Balkh passed down the death penalty after finding him guilty in January this year.
The three-judge panel unanimously overturned the death sentence, but upheld the blasphemy conviction, after hearing evidence from a number of witnesses, including five of lecturers at Balkh University, where Kambakhsh was a student.
The lecturers told the court that Kambakhsh had asked them questions they believed to be insulting to Islam. One, Mohammad Yasseen, accused Kambakhsh of disrupting his classes by asking "hostile, careless and rude questions about Islam".
However, a classmate, identified only as Hamid, told the court his testimony at the first trial had been made under pressure from the country's intelligence department.
The reporter had previously alleged he was tortured during his one-year detention and said his original trial lasted just minutes and that he was given no legal representation.
"The court has sentenced Mr Perwiz Kambakhsh to 20 years jail for the crime he has committed. But this is not the final hearing, he has the right to appeal," Abdul Salaam Qazizada, one of the judges, told the court on Tuesday.
Kambaksh and his lawyer, Mohammad Afzal Shormach Nuristani, confirmed they would lodge an appeal against the jail sentence.
Paris-based media watchdog Reporters without Borders said Afghan justice had failed to protect Afghan law and guarantee free expression.
"By sentencing this young journalist to imprisonment, the appeal court has eliminated the possibility of his being executed, but it has also exposed the degree to which some Afghan judges are susceptible to pressure from fundamentalists," it said.