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, an administration official said.

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.

Cuomo, who has been harshly critical of New York Mayor Bill de Blasio’s efforts to address homelessness, proposed spending $10 billion for 6,000 new supportive beds and 1,000 emergency shelter beds and other homeless services.