A homeless man living out of his car who deliberately knocked down a cyclist in an attempt to get jailed has been handed a life sentence by a German court.

The court in Oldenburg, in northwest Germany, heard how the man drove into an oncoming cycle lane and hit the unsuspecting 48-year-old cyclist on purpose.

He had become homeless after losing his job as a computer scientist and spending all his savings on a trip around Europe.

The court heard the 62-year-old wanted to be handed a prison sentence so he would have “all-round care in a penal institution”.

His victim was seriously injured in the attack and is still suffering from physical and psychological effects of the accident, the BBC reported.

Inside Germany’s abandoned ‘forbidden city’ Show all 8 1 /8 Inside Germany’s abandoned ‘forbidden city’ Inside Germany’s abandoned ‘forbidden city’ A Lenin monument stands in front of the abandoned "Haus der Offiziere" the headquarters for the Soviets' military high command in former East Germany, at the Wuensdorf neighborhood of Zossen. AP Inside Germany’s abandoned ‘forbidden city’ Photo guide Werner Borchert pose for a portrait in the main entrance of the abandoned "Haus der Offiziere", the headquarters for the Soviets' military high command in former East Germany at the Wuensdorf neighborhood of Zossen. AP Inside Germany’s abandoned ‘forbidden city’ A monument of the Soviets' stands in front of a abandoned house at the compound of the headquarters for the Soviets' military high command in former East Germany at the Wuensdorf neighborhood of Zossen Markus Schreiber AP Inside Germany’s abandoned ‘forbidden city’ The doors stand open in a corridor of the abandoned "Haus der Offiziere", the headquarters for the Soviets' military high command in Zossen, eastern Germany AP Inside Germany’s abandoned ‘forbidden city’ The staircase inside the abandoned "Haus der Offiziere", the headquarters for the Soviets' military high command in former East Germany, at the Wuensdorf neighborhood of Zossen. AP Inside Germany’s abandoned ‘forbidden city’ A Lenin monument stands in front of the abandoned "Haus der Offiziere", the headquarters for the Soviets' military high command in former East Germany, at the Wuensdorf neighborhood of Zossen. AP Inside Germany’s abandoned ‘forbidden city’ A part of the abandoned "Haus der Offiziere", the headquarters for the Soviets' military high command in former East Germany at the Wuensdorf neighborhood of Zossen. AP Inside Germany’s abandoned ‘forbidden city’ Views out of a window in the abandoned "Haus der Offiziere", the headquarters for the Soviets' military high command in former East Germany at the Wuensdorf neighborhood of Zossen AP

The court ruled his motivation of seeking permanent care and shelter in jail was malicious and fuelled by greed, and qualified as attempted murder.