(CNN)A Nigerian teen who was convicted in the northwest of the country of blasphemy has had his sentence overturned, his lawyer said Friday.
The appellate division of the Kano State High Court set aside Omar Farouq's sentence on Thursday because he did not have legal representation at his first trial, his counsel Kola Alapinni told CNN.
A Sharia court in Kano State convicted Farouq in August last year and sentenced him to ten years in prison after he was accused of using foul language toward Allah in an argument with a friend.
He will be released Monday after being in captivity for over five months with no access to family or lawyers.
The Sharia court judgment which was nullified Thursday described him as a 17-year-old minor.
Alapinni said Farouq's mother had fled to a neighboring town after mobs descended on their home following his arrest.
"We now need to arrange safe passage for him. His life is in danger in Kano -- it will never be the same," said Alapinni.
The Auschwitz Memorial in Poland has offered to fundraise to pay for Farouq's education, saying in a tweet that "we are all part of one humanity."
In a separate judgment, the court also quashed 22-year-old music studio assistant Yahaya Sharif-Aminu's death penalty sentence for insulting the Prophet Mohammed.
He had not been allowed legal representation before or during his trial -- in contravention of Nigerian citizens' constitutional right to legal representation, said his lawyers.
He was convicted on August 10 for making "a blasphemous statement against Prophet Mohammed in a WhatsApp Group," the judgment document stated.
Blasphemy is an offense that carries the death sentence under Kano State's Sharia Penal Code.
The recording was shared widely, causing mass outrage in the highly conserv