A father’s touching story of generosity is going viral for a heartwarming reason.

Derek Cookson is a photographer in Michigan. He was recently at a park with his daughter when she started playing with another little girl she met there. Her own dad was with her too.

"We shared some small talk," Cookson wrote on Facebook. "But I noticed his little girl kept saying she was hungry from time to time and then running back to play with Quinn. Her dad saying each time, 'OK, booger, we'll go soon.' He would smile to her, but get somber each time she'd run off."

>> Read more trending stories

Cookson struck up a conversation with the girl’s father and learned a little about the man. He spent 30 years in jail for drug offenses and has a young daughter.

"His little girl lived with her mom, and despite the mom’s efforts to keep them apart, he occasionally gets to spend the odd day with her and does his best to give her a fun time," wrote Cookson.

The man suddenly started tearing up.

"On further prodding, he let me know that the partially drank juice in his hands was all he had money for today, and he was dreading when his little girl truly [was] hungry, because he didn’t have any money to get her something to eat," wrote Cookson. "Now, many people would immediately think he was just trying to scam, or it was just a story, but I wasn’t thinking this at all. Despite our differences in life, I just saw us, two dads out with our daughters, who were big the same age."

As they continued talking, Cookson took out his wallet and gave the man all the cash he had on him — about $14. Though it wasn't much, he asked the man to treat his daughter to a good lunch.

The man’s eyes filled with tears of gratitude. Cookson asked him if he could take a photo of him and his daughter, and he “agreed without hesitation.”

After snapping a few photos, he used a portable printer to print off a few photos and gave them to the man.

“When I handed them to him, for the first time in the 30 minutes we’d been talking, I saw him smile a genuine huge smile,” wrote Cookson. “He kept looking at the photos and telling me how blessed he was today, and I realized it was something more important than money could have been on this day. You see, he told me he had no phone, had no email, I don’t even truly think he had a permanent home…but he told me this is the first and only photo he’s ever had of him and his daughter and how much he is going to treasure it.”

Cookson printed out a few more photos for the man who he said treasured them so much, he handled them “as if they were glass.”

“It’s awesome. The adventures and lives you encounter when you just talk with people, and I’m so glad I had my camera, my printer, and $14 in my pocket,” wrote Clarkson. “Rest assured, as I walked back to my car, I held Quinn’s hand a little tighter the whole way.”