President Emmanuel Macron offered Mamoudou Gassama French citizenship for his act of bravery

A Malian migrant who scaled a Paris apartment block to save a four-year-old child was hailed Monday as an "example" by President Emmanuel Macron, who welcomed him to the presidential palace and offered him citizenship.

Two days after his daring rescue -- viewed millions of times online -- Mamoudou Gassama, nicknamed "Spiderman" by French media for his astonishing climbing ability, met Macron in the splendour of the Elysee Palace.

"You have become an example because millions of people have seen you. It is only right that the nation be grateful," Macron told the 22-year-old, adding that his immigration status would be "put in order".

However several aid groups accused the president of "political exploitation", "hypocrisy" and covering up a harsh policy towards migrants.

Macron, who presented him with a medal for bravery, also offered him a job with the fire service.

"I did not think twice. I went straight up," said the sporty youth, who wore jeans and a short-sleeved shirt to the encounter, explaining his climb.

Gassama was also congratulated by Malian President Ibrahim Boubacar Keita, who phoned him at the Paris embassy to congratulate him "for honouring all of Mali," the embassy said.

His act of heroism comes as lawmakers debate a controversial bill that would speed up the deportation of economic migrants and failed asylum-seekers, thousands of whom live in squalid camps in the capital.

"There's a general feeling of shameful political exploitation," said Jean-Claude Mas, secretary general of La Cimade, which defends migrants.

"It raises a lot of questions when you know what this government is doing."

"There's a bit of hypocrisy or cynicism," added Claire Rodier of GISTI which supports immigrants, noting "the contrast with the repressive policy of this government against migrants and those without documents."

Gassama has been living illegally in France and working in construction since arriving in September last year following a perilous journey from his homeland to Libya then Italy.

Macron, a centrist, has taken a tough line on economic migrants fleeing poverty rather than refugees escaping war or persecution.

But Gassama's "exceptional act of heroism" warranted an "exceptional decision", he said Monday.

He leapt into action Saturday evening on seeing the child dangling from the fourth-storey balcony of an apartment in the 18th district.

The video shows Gassama swiftly pulling himself up from balcony to balcony to reach the boy, to the cheers of onlookers.

Firefighters arrived at the scene to find the child, whose parents were not at home, had already been rescued.

A shy figure who was accompanied to the Elysee Palace by his older brother, Gassama said he had acted instinctively.

 'Incredibly brave act'

"I saved the child and then went inside the building and I was shaking," he told Macron.

Reacting to his awards he said later: "I'm pleased because it's the first time I've received a trophy like that."

Gassama's story instantly drew comparisons with that of another Malian migrant who was feted as a hero and given citizenship for helping save lives during a January 2015 terror attack.

Lassana Bathily helped hide hostages in the freezer during a jihadist attack on a Jewish supermarket in Paris, in which four people were killed.

Confirming to Gassama his French citizenship, Macron said: "Even if you did not think about what you were doing it was an act of courage and strength that won the admiration of all."

But in a warning to other African migrants he said he "can not give (papers) to all those who come from Mali or Burkina Faso" -- two of the countries from where thousands set out each year for Europe on a perilous journey across the desert and Mediterranean Sea.

Across the political class Gassama received plaudits.

But a senior member of the anti-immigration National Front, Nicolas Bay, said that while he supported Gassama becoming French all other illegal migrants should be deported.

Dreams of a better life

Passers-by raised the alarm Saturday on noticing the little boy hanging in mid-air.

"Luckily, there was someone who was physically fit and who had the courage to go and get the child," a fire service spokesman said.

The boy's father, who was reportedly out shopping, was arrested for leaving him unattended. His mother was abroad.

The Socialist mayor of Paris, Anne Hidalgo, was among the politicians lining up to phone Gassama to thank him.

"He explained to me that he had arrived from Mali a few months ago dreaming of building his life here," she said.

On Monday, he was made an honorary citizen of the eastern suburb of Montreuil, where he had been sleeping on the floor in a cramped room shared with relatives at a migrant hostel.

The fire department said it looked forward to him joining the ranks.

"We are ready to welcome him on board!" it said.