The seven-year-old Japanese boy who went missing nearly a week ago after his parents left him in a forest as punishment was found unharmed Friday in an army training ground hut, police said, in a case that had set off a nationwide debate about parental disciplining.

Appearing outside the hospital the boy was taken to after he was found, his father apologized and vowed to do a better job of raising him.

"We have raised him with love all along," said the father, Takayuki Tanooka, who along with the boy's mother had made him get out of their car as punishment on Saturday. The couple told Japanese TV news that they left him in a forest, reputed to include bears, and when they returned several minutes later he had vanished.

"I really didn't think it would come to that. We went too far," Tanooka said. He added, "I thought we were doing it for my son's own good."

The boy was found Friday morning by a soldier in a military drill area on the northernmost main island of Hokkaido. The boy identified himself as Yamato Tanooka, the name of the boy who went missing, police said.

Yamato Tanooka, a seven-year-old boy who had been missing since May 28, was found in a hut suffering from dehydration. (Daisuke Suzuki/Kyodo News/Associated Press)

A military officer, speaking on the national broadcaster NHK, said the boy was found when a soldier unlocked the hut, about five kilometres from where he disappeared.

The boy told police he had been in the drill area for several days after walking alone in the forest.

The boy suffered some dehydration and was getting an intravenous drip, but besides some minor scratches on his arms and feet, no serious risks to his health were found, a medical doctor who had examined him was quoted as saying by Kyodo.

More than 180 rescuers, including troops, had been searching the area.

The boy's plight riveted the nation, highlighted in daily news, and setting off some soul-searching about appropriate punishment.

Asked what he had told his son, the boy's father, blinking back tears, said, "I told him I was so sorry for causing him such pain."

The parents reportedly told police they had punished the boy for throwing rocks at people and cars while playing at a river earlier in the day.