At the end of a trial lasting 18 months, frequently delayed by Demjanjuk's complaints of health problems, judges convicted the 91-year-old on Thursday and sentenced him to five years' imprisonment.
However, the court decided to release him pending an expected appeal. He would not have to go to prison in the meantime because he was old, could not travel and posed no danger to German society, the court said. Furthermore, he had already served precisely two years in prison while awaiting the verdict.
"He will be freed today," Margarete Noetzel, a spokeswoman for the court, told news agency AFP.
Given his advanced age, it now looks unlikely that he will serve the full five years, or perhaps any more time behind bars.
Ukrainian-born Demjanjuk, deported to Germany from the United States in 2009, also cannot travel because he is stateless, having been stripped of his US citizenship in 2002 for lying about his war record on immigration forms.
His son John Demjanjuk Jr. said that his family planned to appeal Thursday's conviction.
Earlier, Judge Ralph Alt told the court in Munich he was convinced that Demjanjuk was a guard at the Sobibor death camp "and that as guard he took part in murder of at least 28,000 people."
Demjanjuk maintains his silence
Demjanjuk, deported in 2009 from the United States, where he had lived for several decades after World War II, listened to the sentence in his wheelchair and was then moved to a stretcher in the courtroom.
As the judge read out his decision, an interpreter translated into Ukrainian for Demjanjuk, who kept on his dark glasses and did not move.
Demjanjuk had been brought into the packed courtroom in a wheelchair on Thursday, as usual, wearing a light-blue baseball cap, dark glasses and an army-style green coat which he took off after arriving.
Drinking a glass of water, he was moved to a bed in the courtroom and then appeared to be asleep. During the morning session he was offered the chance for the last time to address the court, but he declined.
Demjanjuk has kept silent throughout the 18 months of proceedings, sitting in a wheelchair or lying on a stretcher. His health was often a cause for concern during the trial, leading to frequent delays.
The former Red Army soldier was captured by German troops in 1942 and sent to a prisoner-of-war camp before signing up to work as a death camp guard.
The prosecution has argued that if he worked as a camp guard, by definition, he is guilty of accessory to the murders of all the Jews killed there at the time.
The high-profile trial, seen as one of the last to involve an alleged Nazi war criminal, has led to much soul-searching on the subject of delayed justice.
The fact that Demjanjuk was a Ukrainian-born prisoner-of-war who now faces justice at the hands of the nation behind the Holocaust has also raised questions.
He is in fact the first foreigner to be judged in Germany for Nazi war crimes.
His lawyer, Ulrich Busch, has described him as "a victim of Germany's justice system".
Reaction pours in
Reaction to the verdict came in from around the world. The Los Angeles-based Simon Wiesenthal Center today praised the guilty verdict.
“John Demjanjuk's Nazi past finally caught up with him,” said Rabbi Marvin Hier, founder and dean of the Wiesenthal Center. “For decades he skirted justice, living a normal life with his family in the United States, successfully covering up his past.
“Today a German court finally put an end to his disguise and set the record straight that he was, in fact, one of the sadistic and brutal murderers at Sobibor and sentenced him to, what for a 91-year-old man, is a life sentence in jail.”
Earlier he served nearly eight years in an Israeli prison, five of them on death row after being found guilty in the 1980s of being the particularly sadistic "Ivan the Terrible" guard at Treblinka, another death camp.
The Israeli supreme court later overturned the verdict and ordered his release on the grounds that he had likely been wrongly identified.
Serge Klarsfeld, a French lawyer and Nazi hunter, has expressed frustration with the trial, saying it failed to provide new details about the case and could not prove Demjanjuk's direct participation in the killings.
"The witnesses are all dead and there are no documents because he was only a small fish," Klarsfeld told AFP. A guilty verdict "would open the door to accusations of unfair justice," he added.
Much of the case for the prosecution rode on whether an identity card - number 1393 - made out by the SS to one Ivan Demjanjuk who was trained with them to become a prison guard and who was sent to Sobibor, was genuine and belonged to the man in court.
The defence insisted it is a fake, adding that no witnesses could place him at the camp.
Cornelius Nestler, a lawyer for the co-plaintiffs, relatives of those killed at Sobibor, said Germany was duty-bound to prosecute Demjanjuk even though the crimes were committed years ago.
"The judicial system and society do not have the right to ignore the facts, saying we just don't want to look at this any more, as used to be the case in the 1950s and 1960s when much of society and much of the justice system felt this way," he told the court.