The killing, as the girls walked to catch their morning school bus, prompted a wave of shock and anger across Germany.
What we know about the attack
The man attacked the two girls, a 13-year-old and a 14-year-old, in December last year, in the Baden-Württemberg town of Illerkirchberg. The younger of the two was able to flee, but the other girl died in hospital from her injuries.
Prosecutors said the defendant, an Eritrean man who came to Germany as an asylum seeker, had been carrying the knife with the plan of forcing local authority officials to provide him with an identity document.
He was said to have been angry with authorities, blaming them for ruining his life because he had no passport to travel home and find a wife.
The prosecution said the man had moved the weapon from his backpack into his pocket when he left his lodgings at an asylum shelter.
He then attacked the girls, suspecting that they had seen him doing so, according to the prosecution.
The man was arrested back at his shelter where officers found him with the knife shortly after the attack.
Such early releases are often the case in Germany when people are handed life sentences.
It was unclear if the man would be deported at the end of his sentence, the prosecution said.