Image copyright Getty Images

A photograph of a man sleeping in a McDonald's in Fayette County, Georgia, has gone viral - but perhaps not for the intended reason.

The photograph was shared on a local Facebook group, with a caption stating it was "just another reason... to leave Fayetteville", along with an angry emoji.

Image copyright Facebook

However, after it transpired the man was homeless and resting between working two shifts at the fast-food restaurant, the local community decided to offer support, rather than ridicule him.

Local reporter Matt Johnson managed to track down the man, Simon Childs, who explained his mother had died recently and he had fallen on hard times.

The 21-year-old added that he was raising his young son and trying to provide for his family.

"It kind of hurt to see my picture up there," he told WSB-TV.

"I thought it was something negative and nobody would care about it."

Mr Childs' situation spurred his local community to respond with kindness, by donating nappies and clothes for his son.

"I didn't think the community would even care enough to do that, but they care," he said.

Two chefs from a nearby restaurant offered to loan Mr Childs a car. And a local barber gave him a free haircut in preparation for attending job interviews,

Mr Childs told the local news station he had received job offers as a result of the Facebook post and was excited about finding a permanent home for him and his son.

Many took to social media to criticise the woman's decision to shame Mr Childs on Facebook.

"It's not cool to shame someone," one person wrote.

While others said the woman's plan to criticise Mr Childs had "backfired".

The woman who shared the photo on Facebook told WSB-TV off-camera she had not intended to shame Mr Childs.

Image copyright @shesota

Others sympathised with the difficulties faced by Mr Childs.

One Twitter user wrote that they "know how it feels to lose a mother and still [have to] deal with the rest of life".

"You simply don't bring a person down when they are already down," they added.

Mr Childs' experience is an example of "stranger-shaming", which involves posting photos or videos on social media to highlight a behaviour that one finds distasteful.

Manspreading, students sleeping at the library, men wearing red trousers and napping commuters have all been the target of ridicule and undercover photography.

Many photographs are shared in private groups specifically set up to criticise a particular behaviour.

For example, one Facebook page dedicated to sharing examples of aeroplane passengers acting inappropriately has more than 516,000 "likes".