A German former nurse who admitted to killing more than 30 patients by administering lethal injections so he could try to revive them apologized to the families of his victims.

The man, identified only as Niels H. under Germany’s court reporting rules, has been on trial since September, accused of three murders and two attempted murders.

The 38-year-old said he is “honestly sorry,” and hoped the families would find peace if he was convicted, news agency DPA reported.

Following his arrest, Niels H. told police that he killed the patients because “he was bored.”

"Usually the decision to do it was relatively spontaneous," he said.

The deaths occurred at the Delmenhorst clinic, where Niels H. worked in the intensive care unit between 2003 and 2005.

A psychiatric expert last month said Niels H. had admitted to killing the patients by injecting them with an overdose of heart medication that lowers blood pressure.

He also admitted to over-medicating another 90 patients, 30 of whom died, according to the psychiatrist.

The man’s plan was to trigger medical emergencies so he could demonstrate what he believed were excellent resuscitation skills.

"There was a tension there, and an expectation of what would happen next," Niels H. told the courtroom.

He said he felt thrilled when he managed to resuscitate a patient, and devastated when he failed.

If Niels H. succeeded in reviving a patient, he would sometimes try to medicate them again for a second attempt, prosecutors said.

The defendant claimed that each time a patient died from the overdose, he vowed to never do it again. But his determination would then slowly fade, he added.

The death rate at the clinic nearly doubled during the time Niels H. worked there, and the deaths of 174 patients during his shift are under investigation.

A colleague caught the ex-nurse in the act of injecting patients in 2005.

Prosecutors are seeking a life sentence for Niels H., who was convicted of attempted murder in 2008 and imprisoned for more than seven years.