A Shanghai schoolboy ran away from home after a failed homework assignment led to an argument with mom. Despite practicing survival skills by trying IKEA mattresses and free-sample food at local supermarkets, the 12-year-old ended up in hospital.

It took Chinese police six days to find Peng Yijian, who ran away from home last week, the Shanghai Daily reported.

The boy failed to complete a math assignment, and was sent home from school last Monday.

His mother’s reaction provoked Yijian’s departure. She later acknowledged, "He was very upset and I feel guilty that I shouted at him."

"I got a phone call from his school saying he hadn’t done his maths homework and was being sent home,” she said.

"When he got here we had an argument and he stormed off. And I didn’t see him again until now," the boy’s mother added.

The woman ran after the lad, but as footage from a surveillance camera near their home revealed, mother and child headed in opposite directions.

With only 1.5 yuan (around US25 cents) with him, the boy apparently lived on free samples when he got hungry – and slept at an IKEA after spending sluggish days roaming around the city. In fact, his mother said, he had some previous experience of running away from home, but never for such a long time.

To find the missing boy, the police asked his family to make a list of his favorite places, so it became easier to spot him on security video near IKEA. The exits of the Swedish furniture store were blocked on Sunday, and the whole ‘boyhunt’ operation took 40 minutes.

“We thought there might be other places he likes to visit, so we asked his mother," Sun Miao, a police officer in Xuhui District, told Shanghai Daily. "She gave us eight or nine names, including Caoxi Park, Nanfang Shopping Mall, In Center and IKEA."

The seventh-grade student was found in a weak state near the escalator on the ground floor. As of Monday, Yijian was still in hospital, where he had been taken to recover from his adventurous week, put on an intravenous drip.

His parents thanked police, local media and their neighbors for their help and support, and promised to have better communications with their son in the future.