A court in the southern German city of Traunstein on Friday sentenced a 30-year-old Muslim refugee from Afghanistan to life in prison for killing a woman who had converted to Christianity from Islam.

Although the man could legally be released after 15 years under the sentence, this seldom occurs in practice.

In giving the harsh sentence, the court accepted the prosecution's argument that the motive behind the killing was a religious one.

The man, whose application for asylum in Germany had been officially rejected, fatally stabbed the 38-year-old woman, also an Afghan refugee, in front of a supermarket in the Bavarian town of Prien am Chiemsee in April last year. The murder was committed before the eyes of two of the woman's sons, aged 5 and 11 at the time.

The woman, who converted to Christianity while still in Afghanistan, had lived in the town since 2011 and was involved in the Protestant church community. The man had only a passing acquaintance with her.

The man had apologized to his victim's relatives in his final address to the court.

Read more: Christian refugee converts in Germany face violent attacks

The killing caused widespread shock in Prien

Plea for leniency

In a summation for the defense, the man's lawyer, Harald Baumgärtl, had appealed for leniency, saying his client had been confronted "from his earliest childhood with violence, blood and death."

The accused, who is illiterate and had undergone psychiatric treatment before the murder, claimed that the woman had called on him several times to convert to Christianity as well. He said this had been hard for him to accept as a Muslim and "disturbed his mind."

The man, who has lived in Germany since 2013, had admitted the deadly attack to a court expert before the trial, but initially told the court he could not remember having committed the crime.

Islam forbids its adherents to convert to other religions or renounce their faith, and doing so is punishable by death in some countries.

The oldest son of the victim told reporters present at the reading of the sentence that he hoped the accused would "receive the punishment he deserved" and not be sent back to Afghanistan, where he would be "celebrated for what he had done."

tj/msh (dpa, KNA)