The man who became an Internet sensation for giving his shirt to a shivering homeless man on a New York City subway was recognized for his act Wednesday during Gov. Andrew M. Cuomo’s State of the State address.

Joey Resto, a Brooklyn resident, took the shirt off his back and the hat off his head to give them to a bare-chested fellow passenger on the A train in Washington Heights last week. Another passenger captured the act on video and posted it to Facebook, where it has received upward of 5.8 million hits, according to several media reports.

“Let’s give Joey Resto a big round of applause . . . for being a Good Samaritan that he is,” Cuomo said during his address, prompting a standing ovation from the crowd at the Empire State Plaza convention center.

Resto, who was invited by the Cuomo administration, waved and smiled in acknowledgment of the recognition.