Harry Shaw, from Surrey, sent Hamilton, a five-time Formula One World Champion, a good luck message on Instagram from his hospital bed. Harry, who has Ewing's sarcoma, said in his video message: "Hello Lewis Hamilton. Good luck wining the race in Spain and thank you for the gifts. Lots of love from Harry and goodbye."
The boy has since moved back to his home for his final days, the BBC reported.
Hamilton described Harry as his "spirit angel" as he dedicated his victory at the Spanish Grand Prix to him on Sunday. "Harry, you don't know how much this message means to me buddy. Thank you so much, you are my inspiration today Harry," Hamilton tweeted.
This brave young man = 💪
— Mercedes-AMG F1 (@MercedesAMGF1) May 13, 2019
Thank you for inspiring all of us this weekend, Harry! 🙏 @HarrysPledge5 pic.twitter.com/WpP6dBqqul
"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".
Mercedes later arranged for one of its cars to be flown to Harry's home, where he is also expected to be presented with Hamilton's winning trophy from the Barcelona race, the report said.
In April, Harry's parents were told he had just one week left to live. Harry's father, James Shaw, said: "I don't know Lewis, but I think what we've seen is what a genuine, decent, lovely person he is. That was a heartfelt message he did and he won that Grand Prix for Harry and that means a lot."
Another crazy day! Harry is holding @LewisHamilton 🏆and a @F1 @MercedesAMGF1 is parked on the drive! #letsjustgetitdone and raise money for children’s cancer research @royalmarsden while Harry still can. https://t.co/W5NQ9Mz4XI #wenevergiveup @CanucksFIN @NataliePinkham pic.twitter.com/Z6BYg7MfZg
— Harry Shaw (@HarrysPledge5) May 13, 2019
Charlotte Shaw, Harry's mother, said: "It's brought smiles into his life at a time when there's a limited amount of fun to be had, to be perfectly honest."
She said gifts including signed photographs and a Mercedes cap first brought smiles, adding: "It just went from there, really. It's just got bigger and bigger and better and better and the smiles have got broader and broader. It's so special to see Harry enjoying himself."