The death of Mason Jones, a pupil at Deri Primary School, near Bargoed, north of Cardiff, is the first caused by the bug which has swept through 38 schools in south Wales and infected 161 people, most of them children.

Nine children were in hospital yesterday receiving specialist treatment for kidney failure or other complications. All were said to be stable or improving.

Mason's grandmother, Mair Jones, said she last saw Mason at 10.30pm on Monday at the Bristol Royal Hospital for Children, where he had been taken for specialist treatment when his kidneys started to fail.

Mrs Jones said: "We had a little hope over the weekend that he was going to get better because, although he was still on dialysis, they had taken fluid off him.

"He could still hear us talking because we were telling him stories.

"We went back down on Monday and his blood pressure was sky high, but the hospital staff managed to settle that.

"I kissed him at 10.30pm and said, 'Grandma will see you tomorrow'. Then Sharon [Mason's mother] phoned at 11.30 to say that he was dying."

Mrs Jones said she got to the hospital at 12.40am but was 10 minutes too late. Mason's father came out of the intensive care unit to tell her he had died.

She added: "Mason was a real character. He bossed everyone around and was dinosaurs-mad. On his bed in hospital there were dinosaurs, snakes and his alligator, and he knew all the names. He was a very bright boy."

Mason's eight-year-old brother, Chandler, has also been treated for suspected E.coli. He is on the mend and was being cared for by relatives yesterday.

Jane Hutt, minister for children in the Welsh Assembly, said Mason's death marked a "sad and sobering moment" in the outbreak which has put 27 people in hospital. She promised that a "no holds barred" inquiry would be held to find out what went wrong and ensure it "never happened again to our children in Wales".

E.coli is a bacterium which exists naturally in the gut, but certain variants can cause illness. The current outbreak is caused by E.coli O157, which produces a potent toxin causing diarrhoea and, in extreme cases, internal bleeding and kidney failure. It is spread through contaminated meat and through contact with farm animals such as cattle and sheep.

The south Wales outbreak peaked in mid-September and is now declining, with 12 new cases of secondary infections - passed on within families - confirmed last week. It is the worst outbreak in Britain since 1996, when 512 people were infected in Lanarkshire and 19 mainly elderly people died.

Soon after the first cases of E.coli were confirmed in south Wales, the outbreak was linked with cooked meat from John Tudor & Son, Bridgend, a supplier to local schools. Bridgend council served two prohibition notices preventing the company from trading after discovering "inadequate disinfection procedures" and risks of cross-contamination. The firm said two rounds of tests had failed to detect E.coli and it was considering challenging the prohibition notices.

A spokesman for the Outbreak Control Group of the National Public Health Service in Wales said: "What the team saw [at John Tudor & Son] caused them to issue the prohibition notices. The team has also visited the school kitchens and the companies that supply to John Tudor and found them all to be satisfactory. There is a clear link between this company and the outbreak."

He added that there had been only a handful of cases in each school, even though 60 per cent of the children ate school dinners, indicating a low level of infection.