An illegal immigrant from Mali in France has become a national hero – with offers of papers, citizenship and a job – after scrambling up the face of a building to save a 4-year-old dangling from a fifth-floor balcony.

How the child got into the predicament isn’t clear, but authorities told a newspaper his father his being charged with neglect.

The immigrant, Mamoudou Gassama, described as “Spiderman” in many reports, responded instantly.

A video spread word of his heroics at the speed of the web.

NPR reported French President Emmanuel Macron offered Gassama citizenship.

Gassama, 22, also was offered a job with the Paris firefighters brigade, the report said.

See his heroics:

NPR reported observers were watching in horror as the child dangled from the balcony, then Gassama jumped into action, scaling from balcony to balcony.

“I ran. I crossed the street to save him,” Gassama said, according to the AP. “When I started to climb, it gave me courage to keep climbing.”

God “helped me,” he said. “Thank God I saved him.”

He reached the child and lifted him to safety while still astride the topmost balcony.

“Bravo,” said Macron, who invited him to the presidential palace.

The AP said Gassama arrived in Europe after crossing the Mediterranean from Libya to Italy. But then he joined an older brother in France.

“Congratulations to Mamoudou Gassama for his act of bravery that saved the life of a child last night,” Paris Mayor Anne Hidalgo tweeted. “He explained to me that he arrived from Mali a few months ago while dreaming of building his life here. I replied that his heroic gesture is an example for all citizens and that the city of Paris will obviously be keen to support him in his efforts to settle in France.”

Note: Read our discussion guidelines before commenting.