A court in southern Germany has convicted a 27-year-old man of murder for killing six members of his family earlier this year.

German news agency dpa reported that the regional court in Ellwangen sentenced the defendant Friday to 15 years imprisonment for fatally shooting his parents, two half-siblings, uncle and aunt during a family gathering in the town of Rot am See.

It also convicted the German man, identified only as Adrian S. due to privacy restrictions, of attempted murder for seriously injuring two other people in the January attack.

The defendant had claimed he wanted to take revenge on his mother, alleging she had abused and tried to poison him with female hormones. He did not provide evidence to support those claims.

During the trial, S. told the court that he had carefully planned the shooting, including by joining a gun club in order to legally acquire a firearm, but later regretted his actions, dpa reported.

Judges ordered the defendant held in a psychiatric ward.