Karanbir Cheema, also aged 13, was taken ill at William Perkin Church of England High School in Greenford at around 11.30am on 28th June.
Taken to hospital in a life-threatening condition, he died with his parents with him on Sunday. A post-mortem examination is scheduled to take place tomorrow.
Alice Hudson, executive head teacher of Twyford Academy Trust, said: "Karanbir Cheema (known as Karan) was a popular Year 8 student at the school. He had many friends who are devastated at his death, as are the staff.
"He was a bright and keen student who excelled in maths. Our thoughts and prayers are with Karan's family."
It became apparent that an incident had taken place which led to the youngster coming into contact with an allergen, prompting police to be called in. Homicide detectives are now investigating.
A 13 year boy attending the same school was detained on 28th June. He has been bailed to return later this month, after being interviewed in connection with the incident.