Ramounas Zykovas was given a 16-year sentence today over the brutal early-hours attack on Dean Ward outside the Arndale Centre in Headingley, Leeds.
A court heard Zykovas, 22, had drunk 12 litres of cider before the attack on August 26 this year.
The Lithuanian national was due to return to his home country the next day after checks on his immigration status revealed he was not entitled to remain in the UK.
Leeds Crown Court was shown CCTV footage of Zykovas approaching Mr Ward before inflicting the injuries as he slept outside a Sainsbury's store.
Michael Smith, prosecuting, said the two men knew each other and Zykovas had given Mr Ward food and money on previous occasions.
Mr Ward had bought Zykovas a coffee a day before the incident to thank him for his kindness.
The prosecutor said Mr Ward often chose to sleep outside the Arndale Centre as he felt safe because the area was covered by security cameras.
Describing the knife attack, the prosecutor said: "The first he knew of the incident was being stabbed in the throat.
"He then realised he was being stabbed all over his body so he got up and ran away. He was stabbed in the back as he did so.
"The footage shows at least 12 stab motions towards Mr Ward's upper body, face or back."
Zykovas left the kitchen knife at the scene and later contacted police to tell them he had stabbed someone.
Officers arrested Zykovas on Kirkstall Road and he asked them: "Is he still alive?"
Mr Ward suffered punctured lungs, injuries to his spine, chest and had part of his nose cut off.
He has been left with permanent nerve damage to his left arm and facial disfigurement.
Mr Ward described the attack in a victim statement read to the court on his behalf.
He said: "I was fast asleep when he stabbed me. I really thought I was going to die.
"I have never know pain like it."
Immigration status was being checked
Zykovas pleaded guilty to attempted murder.
The court heard he was living in supported accommodation in Headingley at the time of the attack while his immigration status was being checked.
Mr Smith said: "The defendant was due to be returned to Lithuania the following day.
"He had agreed to return voluntarily, it having been determined that he was not a trafficked individual. He was not entitled to remain in the UK."
James Keeley, mitigating, said Zykovas moved from his home country to Manchester in 2011.
Mr Keeley said: "He was treated as a modern day slave, delivering charity bags from door to door for no pay.
"He received one meal per day. If he did not work he would be beaten with a stick."
The barrister said Zykovas told the police about his treatment and he was later taken in by the Salvation Army.
Mr Keeley added that his client had suffered from mental health problems and drank heavily as a result of his experiences.
A month before the attack he received a caution for wasting police time over a bomb hoax.
Motive never established
The Recorder of Leeds, Judge Peter Collier, QC, imposed the extended sentence after telling Zykovas he considered him to pose a serious risk to members of the public in the future.
He must serve a 12 year custodial term followed by a further four year period on licence.
The judge said: "You were due to be removed voluntarily the following day.
"I am careful not to read too much in to that, but undoubtedly it must have been playing on your mind when you were in drink that night."
A crowdfunding campaign set up to help Mr Ward after the attack raised £2,000 in less than three days as the incident touched the hearts of many people across the city.
After the case, Detective Inspector Richard Holmes, of Leeds District CID, said: “Zykovas launched a brutal and totally unprovoked attack on the victim as he lay completely defenceless, sleeping rough in a shop doorway.
“He repeatedly stabbed him and inflicted very serious knife wounds, which could easily have proved fatal. The victim had to undergo emergency treatment in hospital and has needed further surgery to his nose which was badly injured.
“The motive for the attack has never been established and, although the two had met before, there was no suggestion of any bad feeling between them that could explain why Zykovas did what he did.
“His actions show he is clearly someone who represents a danger to others and we hope the significant sentence he has received will provide some reassurance to the victim and to the wider community who have rallied round to support him.”