BERLIN — A former nurse on trial on allegations he killed 100 patients at two hospitals in northern Germany apologized to his victims’ relatives in a final statement to the court Wednesday, saying he realized how much pain and suffering he had caused with his “terrible deeds.”

“To each and every one of you I sincerely apologize for all that I have done,” Niels Hoegel, 42, told the Oldenburg regional court after his defense attorneys had made their closing arguments, according to the dpa news agency.

His defense attorneys argued for acquittals in 31 of the 100 counts of murder against him, suggesting there was not enough evidence in those cases.

In total, the deaths — which took place at a hospital in Oldenburg between 1999 and 2002 and another hospital in nearby Delmenhorst from 2003 to 2005 — are thought to be the largest string of serial killings in postwar Germany. Hoegel’s alleged victims ranged in age from 34 to 96.

“Neither we nor Mr. Hoegel deny that he is the perpetrator in many cases,” one of his defenders, Ulrike Baumann, told the court. “But he can only be convicted for crimes he committed and not for crimes he could have committed.”

Hoegel was convicted in 2015 of two murders and two attempted murders. He said at his first trial that he intentionally brought about cardiac crises in some 90 patients in Delmenhorst because he enjoyed the feeling of being able to resuscitate them. He later told investigators he also killed patients in Oldenburg.

Authorities subsequently investigated hundreds of deaths, exhuming bodies of former patients.

Pleas are not entered in the German legal system, but during the seven-month trial, Hoegel admitted to 43 of the killings, disputed five and said he couldn’t remember the other 52.

Both the defense team and prosecutors have asked for a sentence of life in prison, but prosecutors have also asked the court to recognize the “particular seriousness of the crime,” making it likely he’d have to serve more than the standard 15-year sentence.

Prosecutors are asking for a conviction on 97 counts of murder, saying that in three cases, insufficient evidence was presented.

During the trial, Hoegel testified that he had a “protected” childhood, free of violence. He said his grandmother and his father, who were both nurses, had been his role models for going into the profession.

“Now I sit here fully convinced that I want to give every relative an answer,” Hoegel said during the trial. “I am really sorry.”

But Christian Marbach, a spokesman for the affected families whose grandfather was among the victims, doubted Hoegel’s sincerity.