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.