A teenager arrested for allegedly hitting a 4-year-old boy with a hammer in Higashiosaka, Osaka Prefecture, has told police he was driven by a desire to "commit mass murder," investigative sources said Friday.

Police believe the 17-year-old, arrested Thursday, has been chronically depressed since he failed the entrance examination for a high school he was keen to attend two years ago.

The teen, whose name has been withheld because he is a minor, told investigators that after he flunked the exam, he began to buy hammers and other tools that he hid at home, the sources said.

He had also told friends afterward that he had a "desire to kill someone," the sources said.

The teen hit Shota Nishizu at around 3:40 p.m. Thursday at a park in Higashiosaka, fracturing his skull. Although the boy's injuries are serious, he is not in critical condition, doctors said.

The teen had never met the child.

About 20 minutes later, the teen showed up at a nearby police station and told the police: "I'm sorry, but I've just committed an assault on the street. I hit a child's head with a hammer."

In addition to carrying the hammer, the teen was carrying a butcher's knife, a kitchen knife, a stun gun and an ice pick. He was arrested on suspicion of attempted murder.

"I wanted to kill someone," the 17-year-old was quoted as telling the police. "It didn't matter who, except for old people."

According to the teen's acquaintances, he graduated from a middle school in Higashiosaka in March 2003. After failing the high-school entrance exam, he entered the school of his second choice but dropped out a year later, they said.