A Texas police officer went beyond the call of duty last week after learning that a young boy walking alone in an Austin parking lot was out “getting snacks” for a younger sibling.

Officer James Riley was on patrol in the Baker sector of Austin on June 3 when he was alerted to a young child who was reportedly walking alone in a parking lot, the Austin Police Department said Monday.

EX-HEAVY METAL DRUMMER JEREMY SPENCER OF FIVE FINGER DEATH PUNCH FAME SWORN IN AS INDIANA RESERVE OFFICER

After approaching the boy, Riley learned that he went to the corner store alone because he was “getting snacks for a younger sibling.” Police said that Riley drove the young boy home, “concerned for the child’s safety.”

Officer James Riley purchased groceries for a local family after he said they appeared to be “going through difficult financial times.” (Austin Police Department Facebook)

MICHIGAN COP SAVES TODDLER WHO WANDERED ONTO ROAD SECONDS BEFORE TRUCK CRUISES PAST

After arriving at the residence, Riley observed that the family appeared to be “going through difficult financial times.”

That’s when police said he went to a popular Texas supermarket and purchased groceries for the family using his own money.

Officer James Riley was on patrol in the Baker sector of Austin on June 3 when he was alerted to a young child who was reportedly walking alone in a parking lot, the Austin Police Department said Monday. (Austin Police Department)

“He took it upon himself to go to HEB and bought a basket full of groceries and snacks that the boys would be able to fix without turning on the gas stove,” Austin police said in a Facebook post. “He also got some things that a parent would be able to cook for them.”

CLICK HERE TO GET THE FOX NEWS APP

Riley also spoke to the children in the home about safety and warned them against leaving home without an adult.