MUNICH — In what may be one of the last major Nazi war crimes trials, a German court sentenced John Demjanjuk, a former autoworker in Ohio, to five years in prison after he was found guilty of taking part in the murder of 28,000 people while working as a guard at the Sobibor concentration camp in Nazi-occupied Poland in 1943.

Mr. Demjanjuk was nevertheless freed from pretrial detention on Thursday while he appeals, which could take a year. After the verdict Mr. Demjanjuk, 91, was pushed out of the courtroom in a wheelchair and paused briefly before cameras, saying nothing but removing the dark glasses he had worn throughout the proceedings.

Relatives of Sobibor victims, who were recognized as co-complainants for the trial, said they were satisfied with the verdict even though Mr. Demjanjuk would at least temporarily be free. The two years he has spent in jail will be credited to his sentence.

“Whether it’s three, four or five years doesn’t really matter,” said David van Huiden, who said he lost his mother, father and sister after Nazis seized them in Amsterdam and sent them to Sobibor. Mr. van Huiden said he survived because his parents sent him to walk the family dog before the Germans came, and he hid with non-Jewish friends.