It's surely a stunt out of a Hollywood film.

A man's dramatic climb up the side of a building to rescue a child in Paris earned him widespread praise, plus a meeting with French president Emmanuel Macron.

SEE ALSO: NASA shares the story of how a SpaceX launch completely melted this poor camera

22-year-old Mamoudou Gassama, an undocumented Malian migrant, took less than 40 seconds to scale four floors of an apartment block in the city's 18th arrondissement on Saturday afternoon.

Videos of the incident were widely shared on social media, showing Gassama being cheered on by a crowd of onlookers.

Ce jeune est un véritable héros !! 😲 Un acte héroïque ! pic.twitter.com/VYr01BCUdI — Billal RIGHI (@BillalRighi) May 26, 2018

"I saw all these people shouting, and cars sounding their horns. I climbed up like that and, thank God, I saved the child," Gassama said, according to AFP.

"I felt afraid when I saved the child... (when) we went into the living room, I started to shake, I could hardly stand up, I had to sit down."

Firefighters arrived later at the scene. A spokesperson for the Parisian fire department told AFP it was fortunate "there was someone who was physically fit and who had the courage to go and get the child."

Enfant sauvé à Paris: "J'ai réussi à attraper le balcon, et Dieu merci, je l'ai sauvé ", témoigne le héros pic.twitter.com/dI9ALB5JWc — BFM Paris (@BFMParis) May 27, 2018

The mayor of Paris, Anne Hidalgo, congratulated Gassama for his "act of bravery" on Twitter, and said she had called him personally to "thank him warmly."

"He explained to me that he had arrived from Mali a few months ago dreaming of building his life here," Hidalgo added in another tweet.

Il m'a expliqué être arrivé du Mali il y a quelques mois en rêvant de construire sa vie ici. Je lui ai répondu que son geste héroïque est un exemple pour tous les citoyens et que la Ville de Paris aura évidemment à coeur de le soutenir dans ses démarches pour s'établir en France. — Anne Hidalgo (@Anne_Hidalgo) May 27, 2018

"I told him that his heroic act is an example to all citizens and that the city of Paris will obviously be very keen to support him in his efforts to settle in France."

An online petition has been started to help push immigration authorities to receive Gassama's papers. A presidential spokesperson told AFP that Macron will meet Gassama on Monday morning.

Authorities say the child's parents were not at home at the time, according to France 24. The child's father has been placed in custody, and will face court on Sunday evening for neglecting his parental responsibilities.