Silvio Schulz, 33, went on trial last month under tight security in a court in Potsdam near Berlin in a case that stunned the country at the height of 2015's record refugee influx.
"You kidnapped two children, sexually abused them and to our knowledge killed them to cover up the crimes that came before," presiding judge Theodor Horstkoetter said, addressing the defendant.
The mother of the German victim, six-year-old Elias, and the mother and an older sister of four-year-old Mohamed from Bosnia, were present in the courtroom as the verdict was read out.
Schulz was arrested in late October after his mother identified him from security camera images captured at Berlin's Lageso registration centre and published by police.
Police said he admitted to abducting and abusing Mohamed before strangling him to death with a belt. He also confessed to the murder of Elias.
Schulz remained silent throughout most of the trial but as it came to its conclusion he addressed the families of his victims.
"There is no word in the world to describe how sorry I am," he said. "If I could undo what has been done, I would. But I cannot forgive myself."
Schulz abducted Elias from a Potsdam playground in July 2015 before strangling the screaming child to death and burying his body in a rented garden plot.
In early October he kidnapped Mohamed from the crowded and chaotic area outside Berlin's Lageso centre.
The Lageso office was overwhelmed by record numbers of migrants as Germany let in more than one million asylum seekers last year.
As migrant families slept outside Lageso in the dirt, and frustrated refugees sometimes brawled as they waited days for an appointment, parliamentary vice president Claudia Roth condemned the conditions there as "shocking and unworthy of a democratic society".