A high court has scrapped a life prison term for a man and instead sentenced him to 25 years in prison for killing three of his relatives and attempting to murder a fourth in 2016.

Following a psychiatric examination, the Tokyo High Court ruled Monday that Yoshitaka Ikeya, 34, was not fully competent and could not be held responsible for stabbing and killing his grandmother, Mari, 83, mother, Misako, 62, and older sister, Eri, 32, and injuring his father, Hisakatsu, 63, in Hamamatsu, Shizuoka Prefecture.

"The defendant was in a state of diminished capacity under the heavy influence of a delusional disorder," presiding Judge Yoshifumi Asayama said, adding that Ikeya tried to kill his relatives and himself amid delusions he was being bullied at his workplace.

Ikeya was sentenced to live in prison in July 2017 by the Hamamatsu branch of the Shizuoka District Court after concluding he was able to take full criminal responsibility for the attacks.

His lawyers asked the high court to conduct a psychiatric examination on him.

During the trial, they claimed Ikeya was mentally incompetent, but the high court rejected this argument and said the attack was premediated.

Ikeya stabbed the three to death and injured his father with a knife at their home early on April 22, 2016, according to the ruling.