Mada 'Adam' Kabobo was taken into custody shortly after the random attack on a street in the outskirts of Milan last May, in which three passersby lost their lives.
Judge Manuela Scudieri also ruled that Kabobo, said to have been suffering from paranoid schizophrenia at the time of the attack, spend three years in a nursing home, under custody, once the jail term is complete, Il Messaggero reported.
A forensic doctor told an earlier hearing that Kabobo’s mental health was “not compatible with prison”, though a judge previously ruled that he knew what he was doing during the Milan killings.
Ermanno Masini, 64, Alessandro Carolé, 40, and Daniele Carella, 21, died in the attack.
Kabobo arrived in Italy illegally in 2011 and even though his request for asylum was refused, he was not deported.
He had been arrested several times for alleged offences including theft and vandalism.