A German court has convicted a man of raping and strangling a 90-year-old woman and sentenced him to 5 years in prison.

The Dusseldorf state court convicted the 19-year-old defendant under juvenile law Friday of rape, robbery and bodily harm, it was reported.

The victim was attacked in Dusseldorf on a Sunday in October last year just after she visited a church.

A German court has convicted a man of raping a 90-year-old woman and sentenced him to 5 years in prison. Pictured, Souhayl M. in court earlier this month

During the trial, the Moroccan-born man, identified only as Souhayl M. in line with German privacy rules, admitted to committing the attack and said he had been drinking and taking cocaine beforehand.

The defendant grew up in Spain, where he was convicted of narcotics and other offences.

He said he came to Germany in 2016 because he risked going to prison in Spain. Investigators used DNA to track him down.

Prosecutors earlier claimed he confronted her in a church and shouted 'money, money!' at her.

A CCTV image was released after the attack on a 90-year-old woman in October last year

When the elderly woman said she did not have any money to give him, he dragged her outside and carried out the horrific attack before strangling her and pulling her hair.

He also stole the key to her home, but there is no evidence that he later broke in.

Police say they traced the man through DNA evidence, as a sample was on record following a robbery in May last year, RP reports.

The woman needed hospital treatment following the horror attack.