PARIS — France will give residence papers to an illegal immigrant from Mali who scaled the facade of a Paris apartment block to save a boy who was about to fall from a fourth-floor balcony, President Emmanuel Macron said Monday.

Video shows Mamoudou Gassama, 22, risking his life Sunday as he climbed up the balconies to rescue the 4-year-old who is clinging to a railing and glancing at the ground below, while horrified onlookers watch.

The video went viral and Gassama, who has been nicknamed “Spider-Man” for making the rescue in less than a minute, was swiftly granted a meeting at the Elysee Palace.

“This is an exceptional act,” Macron told Gassama. “We’ll obviously be setting all your papers straight and if you wish it, we will start the process naturalization so that you can become French.”

Gassama told Macron he tried to cross the Mediterranean in March 2014 to reach Italy, but was caught by police.

Europe has faced a migrant crisis since 2015 following wars in Libya and Syria and more than 1 million people from Africa and the Middle East have tried to reach the continent via Turkey or by sea.

Macron’s government has said it wants to be both firm and fair on immigration, but it took a tougher stance lately, with parliament approving a bill that tightens asylum rules.

The meeting with Macron was closely followed by French news channel BFM and was the number one headline on Monday morning.

Paris Mayor Anne Hidalgo praised Gassama’s heroism and said the city will support his effort to settle in France. Macron told Gassama he hoped he could get a “meaningful” job in the country.

“What you have done corresponds with what firefighters do; if this fits your wishes, you could join the firefighters’ corps so that you can do (such acts) on a daily basis,” he said.

Gassama told Hidalgo by phone Sunday that he arrived from Mali a few months ago and wished to stay in France.

“I replied that his heroic gesture was 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,” Hidalgo said.

The rescued boy had been left unattended by his parents, BFM said. His father was arrested and then detained following the incident on suspicion of not fulfilling his parental responsibility.

“I did it because it was a child,” French newspaper Le Parisien quoted Gassama as saying. “I climbed … Thank God I saved him.”