An NYPD officer is being commended after his good deed went viral. 

Officer Frank Rendina spotted a homeless man named Ron Brown digging through the trash on Friday.

Rendina says he has known Brown for about two years.

When Brown told the officer that he was collecting cans to save up for socks, Rendina offered to buy him a pair instead.

"I said, 'You know what, it's Christmas. Let's make it Christmas. I'll buy you your socks for Christmas.' He was pretty appreciative. His response was pretty overwhelming. He, he started to cry a little bit," Rendina said. "I wrapped it, I brought it, presented it to him. It wasn't the greatest wrapping job in the world, but it was done."

Rendina's act of kindness was caught on camera by a commuter and went viral after it was posted online.

Police Commisisoner James O'Neill shared the post on his Twitter account. He expressed pride not only for this police officer, but for all police officers.

The chief of the NYPD's transit bureau posted an image of Rendina looking to give the socks the homeless man on Tuesday.