The knifing took place in the victim's apartment in Uddevalla, while the attacker was under the influence of amphetamines, cannabis, pills, spice and alcohol.
Uddevalla District Court heard that the victim had been selected indiscriminately. He was unable to defend himself and died from his injuries.
The attacker – who has not been named by Swedish media – stabbed or cut the man a total of 55 times and continued to hurt his victim even after he had lost consciousness.
He was convicted of murder and jailed for 18 years on Tuesday morning.