When Police Officer Larry DePrimo stopped to help a homeless man in need on a frigid night this month, he had no idea his private gesture would become a public symbol of New York at its gritty best.

But a stranger snapped a cellphone photo of him — which went online this week and has now been seen by millions.

Officer DePrimo was working the Times Square beat on Nov. 14 when he came across a barefoot man hobbling down 7th Avenue. Many folks would’ve just walked on by, but not DePrimo.

“It was freezing out and you could see the blisters on the man’s feet,” DePrimo said this week. “I had two pairs of wool winter socks and combat boots, and I was cold.”

So he stopped into a shoe store and plunked down $75 for a pair of winter boots and thermal socks for the man, whose name he never learned.

As DePrimo squatted down to help put those new shoes on, a tourist from Arizona took the now-famous photo of the scene.

“I was never so impressed in my life,” said the tourist, who sent her photo over to the NYPD, which posted it on Facebook Tuesday. It quickly went viral.

New York cops get bashed every day — so this is an image of the force that is rarely seen, a side its critics would have you believe doesn’t exist.

But the NYPD is not just a wall of blue.

It’s a collection of 35,000 men and women like Larry DePrimo, who spend their days and nights working to protect and serve the city — and who, in quiet moments like this, give a great deal of comfort, too.