A man recently spent more than $500 on Girl Scout cookies – but it wasn't just because he has a sweet tooth.

>> Read more trending news

According to WYFF, members of a Greenville, South Carolina, Girl Scout troop were selling cookies outside a grocery store last week when the generous stranger approached.

>> Need something to lift your spirits? Read more uplifting news

"This man purchased 7 packs of cookies. Gave the girls $40, told them to keep the change. Then he came back to the table and said, 'Pack up all of your cookies. I'm taking them all so y'all can get out of this cold,'" Kayla Dillard, the troop's cookie sales manager, wrote in a now-viral Facebook post. "$540 he spent on cookies. What an amazing soul!!!!"

>> See the Facebook post here

The post, which has been shared more than 8,000 times since Friday, included a photo of the good Samaritan posing with two of the girls.

The man has not been identified.

Read more here.