Seven-year-old Yamato Tanooka was found in a military training base near Shikabe in Hokkaido, just a few kilometres from where he was left.
His parents initially said he had got lost, but eventually admitted briefly abandoning him for being naughty.
His father has apologised to his son and rescuers, saying "we went too far".
How did Yamato survive?
The lost boy and Japanâ€™s parenting debate
World media draw lessons
"My excessive act forced my son to have a painful time," Takayuki Tanooka said in an emotional news briefing outside Hakodate hospital, 30km (19 miles) south, where the boy was taken for checks.
"I deeply apologise to people at his school, people in the rescue operation, and everybody for causing them trouble," he said.
"I have poured all my love into my son, but from now on, I would want to do more, together with him. I would like to protect him while he grows up. Thank you very much."
Search teams including the Self-Defence Forces (SDF) have been combing the remote area, home to brown bears, for nearly a week.
They had found no trace of Yamato and hopes were fading.
But shortly before 08:00 on Friday morning (23:00 GMT on Thursday) he was found inside a building at the SDF base about 4km (2.5 miles) from where he was left.
"One of our soldiers was preparing for drills this morning and opened the door of a building on the base, and there he was," an SDF member told NHK.
"When he asked 'are you Yamato?' the boy said, 'Yes'. Then he said he was hungry, so the soldier gave him some water, bread and rice balls."
It appears rescuers came tantalisingly close to finding him four days ago. The SDF said the base had been searched on Monday but no trace was seen of the boy, who says he reached the hut on Saturday.
The soldier who found him was not part of the search team.
NHK said Yamato had told rescuers he "walked through the mountains" until he found the shelter.
He was taken to hospital by a medical helicopter. A doctor later said he was in very good condition, despite only having had water during his six-day ordeal.
At Yamato's school in Hokuto, near Hakodate, his fellow pupils shouted for joy when it was announced at assembly that he was safe, the Japan Times reports.
Yamato's parents initially said he got lost while they were foraging for vegetables, along with their daughter.  But they later admitted they had driven off, briefly leaving him alone on a mountain road as a punishment for throwing stones earlier. When they returned to collect him shortly afterwards, he had disappeared, they said.
He was wearing jeans and a t-shirt at the time, Reuters news agency reported.
Police have said the parents could face charges for negligence.
The case has gripped Japan, sparking discussions about acceptable levels of discipline for children.
A boy missing in remote woods in Japan since Saturday after being left alone by his parents as punishment has been found alive and well.