The teenager, named Alex Batty, was found in the town of Revel east of Toulouse early on Wednesday morning.
Alex who was 11 years old six years ago, was on holiday with his mother and grandfather when they disappeared in Spain.
A police source said Alex had been taken to a police station by a concerned motorist, according to BBC.
The boy said he had been in France for two years, the police source said, adding that he bore a resemblance to the last known picture of Alex.
He was in good health and did not say he had been mistreated in any way.
The prosecutor’s office in Toulouse confirmed the identity, saying, “It is the missing child. The family have confirmed it.”
His grandmother and legal guardian, Susan Caruana told the BBC in 2018 that she believed Alex’s mother Melanie Batty and grandfather David Batty had taken him to live with a spiritual community in Morocco.
She said they were seeking an alternative lifestyle and did not want Alex to go to school.
A local journalist told the BBC that a delivery driver had spotted the boy walking along a road in the foothills of the Pyrenees, carrying a backpack and skateboard and, feeling sorry for him, picked him up.
“They spent three hours together in the car, and the boy told his story,” Remi Buhagiar of La Depeche newspaper said.
“He said he’d been living in a kind of itinerant commune. He wasn’t under any compulsion but he said he found his mother a bit weird and decided he didn’t want this kind of life, and that he wanted to set his own path – that’s why he decided to leave,” he added.
Alex had been walking through the hills for days, Buhagiar disclosed, saying, “He asked the driver if he could borrow his phone and sent a message via Facebook to his grandmother, saying he was fine and wanted to see her. He was not sure if she got the message,” he said.
The area in the foothills of the Pyrenees is well-known for attracting people in search of alternative lifestyles.
The boy is currently being looked after by social services. British police have been contacted via the embassy in Paris.