Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

DETMOLD, Germany — A German judge on Friday convicted a 94-year-old former Auschwitz guard of being an accessory to 170,000 counts of murder.

Reinhold Hanning was sentenced to five years in prison by the district court of Detmold.

Presiding judge Anke Grudda said the sentence was "the least that a society can do" even though it came "very late."

Reinhold Hanning sat in the courtroom before the verdict Friday. Bernd Thissen / Pool via Reuters

Holocaust survivors and Jewish organizations quickly hailed the verdict, with World Jewish Congress President Ronald Lauder saying Hanning "got the sentence he deserved."

Moshe Kantor, president of the European Jewish Congress, also welcomed the news.

"It should never be too late for the guilty to be held to account," he said.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

In closing arguments last week, prosecutors sought a prison sentence of six years for Hanning and argued that the former SS guard "contributed to the extermination aim of the camp".

Hanning’s defense, however, argued that he was not guilty and had “never killed, nor had he beaten or maltreated anyone.”

While Hanning has denied any role in the killings, he did offer an apology in court and said he "wished he had never been there."

"Finally, finally- a wonderful victory for justice" says #Auschwitz survivor Hedy Bohm (88) after Hanning verdict pic.twitter.com/JpXQ4EvCwt — Andy Eckardt (@ameckardt) June 17, 2016

"It disturbs me deeply that I was part of such a criminal organization," he told the court in April. "I am ashamed that I saw injustice and never did anything about it and I apologize for my actions."

During the four-month trial in northern Germany, several Holocaust survivors gave harrowing testimonies of the horrors they faced at the death camp.

After the verdict 88-year-old survivor Hedy Bohm told NBC News that a "weight" had fallen off her shoulders.

"Finally, finally, a wonderful victory for justice," Bohm said with tears in her eyes. "This is what we fought for for so long."

The corpses of hundreds of thousands of victims, who were gassed or died of starvation and disease, were later burnt in the crematoriums and their ashes often used as fertilizer for nearby fields.

In total, more than 1.1 million Jews were killed at the Auschwitz camp in Nazi-occupied Poland.

Of more than 6,500 former SS personnel at Auschwitz who survived World War II, fewer than 50 have been convicted of atrocities by the German justice system.

Hanning was tried under new legal reasoning that as a guard he helped the death camp operate, and can thus be tried for accessory to murder.

The same argumentation used in Hanning's case was used successfully last year against SS sergeant Oskar Groening, who was convicted of 300,000 counts of accessory to murder for serving in Auschwitz.

Out of the 30 investigations that were launched against former SS personnel at Auschwitz in recent years, only five remain active. Most were either closed due to a lack of evidence, death of the accused or because the defendants were not fit to stand trial.

The ages of those accused have led many to fear Hanning's trial might be one of the last Holocaust-related trials.

“Now it is a race against time,” Jens Rommel, director of Germany’s Central Investigation Center for Nazi Crimes, told NBC News.