The heroic deed happened earlier this month at a Lidl supermarket in the city's industrial district of Mirafiori.
The Egyptian immigrant was waiting at the supermarket checkout when the man in front of him – a 52-year-old Italian – pulled a knife on the cashier and told her to empty the cash register, La Stampa reported.
The woman was forced to hand over €700, but as the armed robber turned to leave the store the immigrant lunged into him, tackling him to the ground.
He then restrained the assailant until the police came. “I am aware of the consequences of my actions,” he told them.
A video of the incident can be seen below.
Not only had he risked his life but he also faced possible deportation, because he was unable to present the police with any documentation.
Story continues below…
But the officers had no intention of deporting the man. Instead, they took him to the immigration office at police headquarters, where they processed a residency permit request for him on the grounds of political asylum.
Having completed an application for residency, migrants can legally work in Italy, meaning they are no longer forced to depend on odd jobs paying cash in hand.
This is not the first time that an illegal migrant has been given a residency permit following a heroic deed.
Last May, a Bangladeshi man was given a year-long permit to stay in Rome after he leaped into the River Tiber to save a drowning woman.