Jack Swanson was saving money in his piggy bank, mostly pennies, to buy an iPad. Instead, he handed the $20 to the Islamic center in his town last week.
The story got the attention of international human rights lawyer Arsalan Iftikhar, who says he was touched by Jack's kindness, and mailed an iPad to Jack.
Photo posted on Iftikhar's Facebook page show a joyous Jack holding up his new device. He wrote: "Dear Jack...You had saved $20 in your piggybank for an Apple iPad...But then a local Islamic mosque was vandalized...So you donated your $20 to this local Texas mosque instead...Because of your amazing generosity & kind heart...Please enjoy this Apple iPad with our sincere thanks...Love...The American Muslim Community."
The Islamic Center of Pflugerville, a suburb of Austin, was vandalized last week with torn pages of the Koran, which were smeared with feces.
"Jack's $20 are worth $20 million to us because it's the thought that counts," mosque board member Faisal Naeem told ABC News. "Jack is just a little older than my son, Ibrahim. If we have more kind-hearted kids like them in the world, I have hope for our future."
Jack's mother said the boy wanted to help out and show that "what happened in Paris is not what's happening in Pflugerville."
Naeem points out that there's no direct evidence that the vandalism was connected with the Paris attacks, but lamented the "generalizations" that are often applied to Muslim communities after extremist attacks.
"It's become so commonplace where something goes wrong somewhere and people want to blame all Muslims," he said. "If anything, it's a pointing indictment of the logical fallacy in our society's way of thinking."
No physical damage was made to the mosque, but clean-up costs are expected to be about $150. Naeem said that he was encouraged by the community's support.
WLS and KGO contributed to this report.