A German court handed an Afghan man a life sentence on Thursday for a car-ramming attack in Munich last year which killed a two-year-old girl and her mother and left dozens injured.

The court in Munich found the man, named only as Farhad N., guilty of two counts of murder, 23 of attempted murder and 22 counts of bodily harm, 19 of them serious.

The court found that the offences carried a "particular gravity of guilt," a designation that makes it much less likely that the 25-year-old will ever be released from prison.

The attack was one of several committed by foreign nationals in the run-up to last year's general election that inflamed debate on immigration and security.

It also came on the eve of the Munich Security Conference, a major gathering of high-level figures from the worlds of politics and defence.