Want smart analysis of the most important news in your inbox every weekday along with other global reads, interesting ideas and opinions to know? Sign up for the Today's WorldView newsletter.

Over the weekend, the world was transfixed by footage of a Malian migrant in Paris rescuing a toddler hanging from a balcony. In an extraordinary act of bravery, 22-year-old Mamoudou Gassama swiftly climbed four stories up the facade of an apartment complex in the French capital, grabbed the dangling child and lifted him to safety. The feat earned him the sobriquet "Le Spider-Man" on French social media.

"I didn’t think about the floors," Gassana told Le Parisien. "I didn’t think about the risk."

His heroism won the undocumented immigrant an invaluable prize: a pathway to French citizenship. French President Emmanuel Macron hosted Gassama on Monday at the Élysée Palace, congratulating the young Malian on his "exceptional act" and offering him a position in the emergency services. (An article in France's civil code provides for the fast-tracking of naturalization for individuals who have performed "exceptional services for France.")

The next day, photos circulated of Gassama visiting a Paris fire station, where he was signing up for a 10-month internship. He is expected to receive French citizenship in about three months.

Gassama visits the Paris Fire Brigade headquarters and Champerret fire station on May 29. (Erwan Thepault/Agence France-Presse)

But no matter the fairy-tale ending, Gassama's story was a familiar one before this weekend's events. He had been living in France for around six months, after enduring the perilous journey from Mali through war-ravaged Libya and over the Mediterranean to Italy. It's a passage that has been made by thousands of others in recent years — and killed thousands as well.

Gassama eked out a precarious existence in obscurity. "Without legal documents in France," reported the Guardian, "he had been sleeping on the floor of a residence for migrants in Montreuil, outside Paris, rolling out a thin mattress each night and packing it up in the morning, sharing a cramped room with six others and unable to work legally."

Before his act of daring, Gassama was a faceless statistic. "It’s hard not to think about the Russian Roulette of the undocumented," wrote Nesrine Malik in the New Statesman. "What if it hadn't been filmed? How many of these daily acts of selflessness go unrecorded and unawarded? How many good immigrants have not had the chance to demonstrate their value to the country because they have not saved a life?"

Macron himself has taken a strikingly tough line on immigration, one that could not be obscured by Monday's cheery photo-op. "Macron’s government has cracked down on economic immigrants in particular and has doubled the amount of time that authorities can detain newly arrived undocumented immigrants," reported my colleague James McAuley. "Meanwhile, the Interior Ministry has ordered the closure of makeshift migrant camps in Paris; a young male immigrant at one of the camps drowned this month."

The sad irony of the moment is that, until he was crowned a hero, Gassama was treated as a villain. The mere existence of men like him has given life and power to far-right political movements in Germany, Italy and France; fear of them has been a signature tactic of President Trump's politics, and that fear underlay arguments for travel bans on refugees and nationals from certain Muslim-majority nations.

For people like Gassama, the path to a normal life and legal status "is fraught with immense difficulties, and they must navigate it in a climate dealing with rising populism and Islamophobia," wrote H.A. Hellyer of the Atlantic Council. He added that none of the positive coverage of the Malian immigrant's actions centered on his religious identity. There's nothing at all wrong with that, Hellyer observed, but "had Gassama done something violent, the coverage would have definitely included speculation about Islam’s role in his life — and about Islam itself."

Migrants like Gassama are part of a world system that, though marked in so many ways by globalization and interdependence, throws up barriers to their dreams. When they seek to travel, they are often denied, suspected of having ulterior motives. When they seek to find work and opportunities abroad, the societies that once colonized and looted their native lands turn a cold shoulder or try to cast them out.

While hundreds of migrants have died simply trying to reach Europe, most Americans and Europeans take their mobility for granted. "The paradox of the passport is easy to forget in the West, since papers from North American and European countries grant citizens visa-free access, albeit temporarily, to almost anywhere they’d want to go," noted Atossa Araxia Abrahamian, author “The Cosmopolites: The Coming of the Global Citizen.” “It’s not surprising, then, that when it comes to selling cars, credit cards, even mobile phone plans, the term 'passport' is used as a stand-in for 'freedom.' A German can visit 177 countries visa-free; an American, 173; an Afghan, just twenty-four."

That fundamental inequity is difficult to ignore, especially at a time when technology makes it virtually impossible for a poor person sitting in Mali or Afghanistan not to see the possibilities that lie elsewhere. "Citizenship is itself the primordial kind of injustice in the world," observed Rana Dasgupta, author of a forthcoming book on the waning of nation-states. But that's not a sentiment popular among the publics of the West, where nationalism is once more resurgent. Even then, simple tales of good deeds ought to help build empathy.

Gassama was not the first Malian migrant to win French citizenship for heroism. In January 2015, Lassana Bathily saved the lives of six hostages trapped in a Jewish supermarket. He was later feted with a French passport, went on to write a book, titled "I Am No Hero," and funded an irrigation project in his home village in western Mali. He remains in France.

"I just continue to live, I continue to do what I did before," Bathily told journalists in 2016. "We must show solidarity, we must stay united. There is hope."

Want smart analysis of the most important news in your inbox every weekday along with other global reads, interesting ideas and opinions to know? Sign up for the Today's WorldView newsletter.