A 22-year-old university student armed with a knife and a hammer attacked a policeman at a police substation Thursday in Toyama, the same city where an attack last year on a police box left an officer and another person dead.

Masaki Maeda, a resident of Toyama, visited the substation around 3 p.m. pretending to have brought lost property. He attacked a 30-year-old police officer, Hiroki Yamamoto, on the head with the hammer and cut him with the knife, local police said. The officer, who sustained head injuries, overcame and restrained the attacker.

Maeda was arrested for attempted murder. He admitted assaulting the police officer and said he wanted to take the officer's gun to commit suicide, investigators said Friday.

Yamamoto lived at the substation with his family but he was alone at the time of the incident as his family was out.

"The officer's face was covered in blood as he sat astride a man (after overcoming him)," said a farmer in his 70s who went to the scene after hearing police car sirens.

In the same city last June, a former member of the Self-Defense Forces stabbed to death an officer in a police box, stole a handgun and shot dead a security guard at a nearby school.