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.

The group claim they are owed $40,000 (Â£23,500) by the Illinois-based outfit WorldWide Fan Clubs.
The company had been charged with managing subscriptions and fan records for Duran Duran, with 75% of profits going to the musicians.
Its owners declined to comment when contacted by the Associated Press.
According to their legal action, filed in Cook County Circuit Court, Duran Duran also contend that the company - which operates out of the town of Glenview - failed to keep accurate accounts of fan club activity since they gained the contract for the work in 2010.
It also stated they have made repeated requests for the unpaid fees to be settled.
Part of their brief was to process subscriptions from fans, while their headquarters would also serve as a warehouse for the distribution of band merchandise.
They were entitled to keep 25% of proceeds for their activities.
Duran Duran were formed in Birmingham in 1978, with its core members Simon Le Bon, Nick Rhodes and John Taylor still in the line-up today.
They have enjoyed a string of hits in both the UK and US, including Hungry Like The Wolf and Rio.
In 2012, they performed at a concert to mark the opening ceremony of the London Olympics in Hyde Park.
The band are currently at work on their 14th studio album.
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.
[NEXT_CONCEPT]
Pop band Duran Duran have taken legal action against the US company charged with running their fan club over unpaid revenues, court papers have revealed.