Egyptian immigrant Mohamed Ali Abdelmoatty Kenawy, who was attacked three weeks ago in what appeared to be a hate crime, works at his food stand in Rio's Copacabana neighborhood

When video went viral of a racist attack on a Muslim street food vendor in Rio de Janeiro, Brazilians wondered gloomily: had their country also been swept up in a global wave of xenophobia?

The answer -- a flood of love transforming the humble vendor into a folk hero and, on Thursday, the recipient of a Rio state award -- was a heartwarming no.

But the truth may be a little more complicated.

It all began August 3 when Mohamed Ali Abdelmoatty Kenawy, 33, was manning the cart from which he sells Arab-style meat pies and hummus in the thronging center of Copacabana.

Suddenly a thick-set, bald man carrying two sticks appeared, screaming at Kenawy, who came to Brazil three years ago and has since become universally known as "the Syrian refugee."

"Get out of my country!" yelled the assailant. "I'm a Brazilian and my country is being invaded by these miserable human bombs who kill children!"

Thin, with neat dark hair and glasses, Kenawy did not attempt to fight back, merely picking up food that had been spilled when his cart came under attack.

The incident might have got even uglier, except that among the growing number of bystanders was 19-year-old Beatriz Bastos de Souza, who intervened, and then began filming on her mobile phone.

"The man started to kick the cart and then started to kick and punch Mohamed," she said Thursday. "There were three or four of them, not just one, and I went into the middle saying, 'Please stop.'"

Deeply depressed, Kenawy avoided work for the next two days. "That man didn't break my cart," he told AFP. "He broke my happiness."

Bastos de Souza, however, left determined to do something.

After Kenawy refused her pleas for him to file a police complaint, she showed officers her video of the fracas.

"They said, 'Delete it, nothing will come of it,'" she explained.

So Bastos de Souza, who works in a travel agency, sent the video to Brazil's biggest news organization, Globo.

They also didn't respond. But the video made it to a smaller news outfit and all of a sudden, "my video was everywhere," she said.

The effect was extraordinary.

Soon Kenawy was doing a sit-down interview on Globo. Thousands of people organized on Facebook to buy his pies and Rio Mayor Marcelo Crivella personally handed him a hard-to-get vendors' license.

On Thursday, Rio state legislature voted to make Kenawy an honorary citizen.

"I knew Brazilians were kind, but after this, wow," Kenawy said in amazement. "I can't express my feelings."

- 'Different Brazils' -

Kenawy has now become a byword in the Brazilian media for tolerance -- the Syrian war survivor who, when confronted with violence, declined to strike back.

"He displayed the desire for peace and prosperity that is shared by all those seeking refuge in Brazil," said Rio state lawmaker Wanderson Nogueira, who sponsored the state honor for Kenawy.

Barely five minutes go by at Kenawy's Copacabana corner without passersby or drivers shouting out "Congratulations, Mohamed!" or stopping to pose for a photo.

But for starters, Kenawy is not a refugee from Syria.

Although his family has Syrian roots, he is an Egyptian citizen and moved in search of a better economic future when his restaurant had to close.

In Brazil, he didn't even apply for asylum, instead obtaining a permanent residency card after marrying a local woman with whom he now has a three-month-old son.

"I wasn't in a war," he said.

What he is, is an archetypal poor, hard-working, ambitious immigrant.

In Rio, he started selling pies from a tiny table, then the cart.

Now he dreams of a food truck.

The anti-Muslim assault may not necessarily have been exactly what it appeared to be either.

Although brutal and racist in nature, the motive may have been more to do with a turf struggle between street vendors, according to local media.

Bastos de Souza said Kenawy had upset a smalltime "mafia."

And one of the many people milling around Kenawy's cart said it was unfair that the newcomer had taken a corner previously held by locals.

"The Brazilians get thrown out, is that fair?" asked the man, who did not want to be identified.

But whatever the details, the Egyptian's fairy tale story has delighted Brazilians.

Buffeted by recession, bloody crime and corruption, they're glad to be reminded of their better angels.

"I think what happened was a portrait of the different Brazils -- the welcoming Brazil and the prejudiced Brazil," said singer Juli Mariano, 50, who demonstrated support by buying a pie Thursday.

"And I think the welcoming version won."