Train dispatcher Michael P. was given three-and-a-half years in prison for involuntary manslaughter and bodily harm, judges in the Bavarian town of Traunstein ruled on Monday.

On February 9, two commuter trains carrying 150 people crashed head-on on a single-track line in Bad Aibling, in one of Germany's worst train accidents in decades.

The crash killed 12 people - four train drivers and seven passengers - while injuring 89 others.

The train dispatcher admitted to a string of mistakes leading to the crash

The 40-year-old train dispatcher admitted to misconduct at the opening of the trial last month. He ended up setting the wrong train signals and when he had a chance to prevent the collision through an emergency call to the train drivers, he dialed the wrong number.

Prosecutors pushed for a four-year jail sentence while the defense requested two-and-a-half years, saying their client acted out of panic. The maximum sentence under German law is five years.

In a statement read by his lawyers, the dispatcher addressed the family members of the train crash victims - 20 of whom took part in the trial as joint plaintiffs.

"I know that I cannot undo what has happened, even if I wish I could," he told them. "I would like to tell you that my thoughts are with you."

Chain of errors

Michael P. also admitted to playing a game called "Dragon Hunter 5" on his cell phone shortly before the crash. Prosecutors argued that the game likely distracted the defendant, leading to the series of fatal errors.

German railway operator Deutsche Bahn prohibits the private use of smartphones while on duty.

According to evidence presented in the trial, the signal technology used along route where the accident took place was over 30 years old. A 1984 provision to install additional signals on the track was not carried out, a crash expert from the state Railroad office testified.

An automatic braking system that is intended to prevent head-on collisions was apparently disabled before the crash.

Authorities investigating the disaster, however, ruled out a technical defect as the cause.

The accident in Bad Aibling was Germany's first fatal train crash since April 2012, when three people were killed and 13 injured in a collision between two regional trains in the city of Offenbach.

Germany's deadliest post-war rail accident occurred in 1998 when a high-speed ICE train derailed in the northern town of Eschede, killing 101 people and injuring 88.

rs/kms (AFP, dpa)