A 17-year-old boy was fatally stabbed in Arizona by a man who said the rap music the victim was listening to made him feel “unsafe,” the police said.

The victim, Elijah Al-Amin of Glendale, had finished work at a Subway sandwich shop and stopped at a Circle K convenience store in Peoria early Thursday morning, relatives said. He was standing at a soda machine around 1:45 a.m. when Michael Paul Adams, 27, who had been released from prison two days earlier, stabbed him in the back and slit his throat, witnesses told officers from the Peoria Police Department.

The two were not believed to have known each other, and witnesses reported that Mr. Adams did not say anything before the attack. Elijah fled the store, bleeding profusely, and collapsed in the parking lot, according to a probable cause statement. When emergency responders arrived, a witness was trying to stop the bleeding from his neck. He died at a hospital about 20 minutes later.

Image Elijah Al-Amin

Mr. Adams simply walked out of the store after the encounter, much of which was caught on surveillance tape . The police found him nearby, stained with blood and carrying a folding pocketknife, and he admitted to the killing, according to the statement.