It came after Aiden Vazquez, 10, a "Star Wars" fan, was bloodied by tormentors at his school, his mother said.
The boy's actions got the attention of Hamill, who portrayed Jedi knight Luke Skywalker in the “Star Wars” franchise.
"I'm so proud of you for showing that you can be a Jedi in real life," Hamill posted. "Congratulations, Aiden- The Force will be with YOU... Always!!! Your fan, mh."
Hamill added how surprised he was by the boy’s actions.
“I’m astonished by his wisdom & courage such a tender age," he wrote. "I may be a fictional Jedi, but this boy is the real deal. Not sure how to reach out to him, but I hope he sees this message & knows how much I admire him."
Aiden, a fifth grader, needed stiches after he was punched in the face and called names by bullies at his school in the town of Desert Hot Springs.
His story went viral after his mom posted the photos of her son on Facebook, venting, “This is the third year my son is bullied!!"
Lizette Casanova and her brave son, who still has a black eye, is now calling on the school district to end bullying.
The school did not return Inside Edition's request for comment.
The boy's mom has filed a criminal complaint and police are launching an assault investigation.