A police officer's job is to protect and serve and one rookie officer took the latter part to heart when he bought diapers for a struggling mother accused of stealing them for her infant son.

HELPING K-9's: Woman donates $4000 for bulletproof vests for police dogs

Officer Bennett Johns responded to a shoplifting call at a grocery store in Maryland, for a young mother caught by security attempting to steal two packs of diapers for her 2-year-old son earlier this month.

The mother told Johns that she purchased some groceries and didn't have enough money to buy the diapers.

Story continues below...

Officer Johns said this situation reflected his own growing up and decided to purchase the diapers out of his own pocket so that the young child would not suffer.

GIVING BACK: These are the 50 things you can toss or donate and not miss afterward

"I see [the toddler] and I see myself growing up with a single mother and I want him to have a better life too," Johns says in the video above, which has gone viral.

The officer did issue the woman a criminal citation for theft. The theft charge is a misdemeanor.