Harry Shaw, 5, suffered from a rare form of cancer called Ewing's sarcoma. Shaw sent a video message to Hamilton ahead of the Barcelona race on May 12 to wish him luck -- Hamilton duly won and afterwards said he had been inspired by the message, labelling Shaw his "spirit angel."
On Monday evening, Shaw's family confirmed he had died at the weekend. The youngster's fundraising page has surpassed £230,000 ($291,700).
Hamilton and Mercedes posted a tribute to him on Tuesday.
Harry, thank you for being such a positive light to us all. You're so brave and the world will miss you dearly. Thank you, friend and inspiration pic.twitter.com/JLPg4VJrxU— Lewis Hamilton (@LewisHamilton) June 4, 2019
❤ Harry, you've inspired us all with your amazing strength and bravery.— Mercedes-AMG F1 (@MercedesAMGF1) June 4, 2019
You will be racing with us forever more - and we will be "getting it done" in memory of your incredible courage 💪 https://t.co/g15Dwu9cc9
In an Instagram post after the Spanish Grand Prix, Hamilton said: "You are such a strong boy, I wish I was strong as you. I wanted the world to see how strong you are."
View this post on Instagram
Harry, you don't know how much this message means to me buddy. Thank you so much, you are my inspiration today Harry. I will try to make you proud. You are such a strong boy, I wish I was as strong as you, I wanted the world to see how strong you are and ask everyone to send their best wishes and prayers to you during this hard time. Sending you love Harry. God bless you. Your friend, Lewis #keepfighting #nevergiveup #wewinandwelosetogether
The following day, Mercedes arranged for its race-winning car and trophy to be delivered to his house in Surrey, England.