Image copyright SNapchat Image caption A Saudi man found himself on the receiving end of a torrent of online abuse after posting this photo on Snapchat.

After a sharply dressed Saudi man mocked a young migrant picking through rubbish, others rushed to try to find the girl and give her money.

The young man stopped to take a selfie in front of an African migrant picking through rubbish in Jeddah. He spotted that the young girl, maybe about 10 years old, was wearing a shirt displaying the logo of the al-Ittihad football team, and saw the opportunity for a quick joke.

"Look at where al-Ittihad is, in the bin," the man wrote underneath the photo on the image-sharing app Snapchat.

The image was then taken off Snapchat and widely shared on other social networks, as well as reported in the media. Not many people found it funny. The overwhelming sentiment online was outrage and anger: people who saw the picture thought it was in poor taste, even racist, and that the man was using a poor child as a prop.

"It's a publicity stunt, poor girl doesn't even know what's going on, he's pathetic," one commented on Twitter.

The incident highlighted the tension between Saudi nationals and migrants, many of whom work difficult jobs and struggle to make ends meet. In the past there may not have been much public sympathy for migrants rights in the country, and indeed some of the anger with the man came from outside Saudi, but on this occasion large numbers of Saudis too joined the condemnation of the man. "This guy does not represent me," one Saudi female tweeted.

Image copyright SNapchat Image caption The Saudi man returned to the young girl to give her gifts

The man apologised in a YouTube video and he even returned to the girl and posted a picture of himself giving her presents. Meanwhile others leapt in to try to help her, but because her identity isn't known they had to try and find her and a hashtag that translates as "search for Jeddah child" attracted more than 200,000 tweets. One wealthy al-Ittihad fan promised to donate more than US$16,000 to the girl and others including Saudi racing car driver Yazeed al-Rajhi also made pledges - more than $100,000 worth in all.

"Saudi society is a very generous society ... but let's see if they follow up on what they say," says Forgan al-Madhi, a Saudi social media commentator who lives in London. "A more important issue would be to question what we're doing about illegal migrants than dealing with one little girl," he says.

The girl hasn't yet been found, and so it's not clear whether she will ever receive the large sums pledged for her.

Reporting by Gemma Newby and Mai Noman

Blog by Mike Wendling

Next story: Why is a Chinese takeaway box taking over election talk?

You can follow BBC Trending on Twitter @BBCtrending, and find us on Facebook. You can even vote for us - we've been nominated for a Webby Award.