Hundreds of people marched through the northern Californian town of Santa Rosa on Wednesday night to demand justice for the death of a 13-year-old boy shot by police while carrying a pellet gun to his friend’s house.

Andy Lopez was killed the day after a 12-year-old boy shot dead a maths teacher and himself at a school in the neighbouring state of Nevada. Two Santa Rosa sheriff’s deputies said they opened fire after repeatedly asking Andy to drop the replica assault rifle, which they believed to be real. The teenager was declared dead at the scene on Tuesday.

According to the Sonoma County Sheriff’s Office, the deputies were driving by when they spotted the teenager walking “with what appeared to be some type of rifle”. Lopez had his back to the officers, who did not realise he was a boy. They called for backup and, they said, ordered him twice to drop the gun. The teenager was around 20-30ft away when he turned towards them. “He was holding the weapon in his left hand,” said Lt Paul Henry of Santa Rosa Police. “He began to turn toward his right in the direction of the deputy, and he moved the gun toward the deputy, and the deputy’s mindset was that he was fearful he would be shot.”

Download the new Independent Premium app Sharing the full story, not just the headlines

One eyewitness recounted the incident to the news station KGO-TV. “He pulled over to the kid walking and he just opened the door and shot him, three shots,” Ismael Mondragon said.

The boy’s father, Rodrigo Lopez, told reporters his son had borrowed the replica AK-47 from a friend, and was walking to the other boy’s home to return it. “It’s not right what they did to my son,” Mr Lopez said.