A police officer in Austin helped a young boy get home, and then returned with groceries for his family. (Photo: Facebook)

An Austin, Texas police officer, concerned for a young boy's safety, drove him home and then later returned with groceries for his family.

The Austin Police Department shared on their Facebook page on Monday that Officer James Riley was working in Central West Austin when he noticed a young boy who was alone in a grocery store parking lot. The boy informed the officer that he was there to buy snacks for his younger sibling.

"Concerned for the child's safety, Officer Riley gave him a ride home," the Facebook post explained of the June 3 incident. "Once inside the residence, he found out that the family was going through difficult financial times."

After explaining to the children about safety, and cautioning them that they should not leave their home without an adult, he returned to the grocery store and bought the family a cart full of groceries and snacks, most of which could be prepared without the boys having to turn on their gas stove.

"Please join us in commending Officer Riley for helping out a family in need. He showed true heart with this act of kindness and is just one example of how our officers work to make Austin a safe community," the post finished.

"His parental instincts kicked into motion. I have the honor of calling him a good friend for close to 20 years. He's a great dad and good officer," one member of the community commented.

"Not only protecting the young citizens but serving God too. Well done Officer Riley!" another commented. One added, "Thank you for going above and beyond, especially for the youngest citizens of Austin."

More commenters shared that they were sure that Officer Riley's compassion and caring have made a likely lasting impact on those children he helped.

Read more from Yahoo Lifestyle:

Follow us on Instagram, Facebook, Twitter and Pinterest for nonstop inspiration delivered fresh to your feed, every day.