Noah Berger / Reuters Mourners arrive at an open casket viewing for Andy Lopez Cruz in Windsor, Calif., on Sunday.

Protesters will rally Tuesday in a San Francisco suburb where a 13-year-old boy who was carrying a plastic replica of an assault rifle was shot to death by a sheriff’s deputy last week.

Authorities said that the boy, Andy Lopez Cruz, had his back to the deputy and a trainee when they ordered him twice to drop the gun. The boy turned and raised the tip of the gun, and the deputy began firing from 20 to 30 feet away, authorities said.

The deputy fired eight rounds, seven of which struck the boy, the coroner said. The gun looked like an AK-47 assault rifle but fired BBs, police in the suburb of Santa Rosa said.

The deputy, identified by sheriff’s officials as Erick Gelhaus, 48, has been on the force 24 years, including 19 as a firearms instructor. He also served 10 years in the military, including a tour in Iraq, said Lorenzo Duenas, the Sonoma County assistant sheriff.

Gelhaus has been placed on administrative leave, as has the trainee, standard procedure while investigators look into a police shooting.

Noah Berger / Reuters A girl reads signs in a vacant lot where 13-year-old Andy Lopez Cruz was shot and killed in Santa Rosa, Calif.

There has been a protest or vigil every day since the boy was shot to death Oct. 22, NBC Bay Area reported. On Tuesday, protesters are to rally at Santa Rosa Junior College and the courthouse square before marching to the sheriff’s department for a rally.

Relatives and friends have said that the boy, a popular eighth-grader, was walking near his home and planning to return the replica gun to a friend.

Gelhaus has never fired upon a suspect in his 24 years on the force, sheriff's officials said. He accidentally shot himself in the leg in 1995 while holstering his firearm on duty, the San Francisco Chronicle reported.

In a 2006 post on Firing Line Forum, an online network for gun enthusiasts, Gelhaus wrote about the use of force against someone carrying a BB gun.

“It’s going to come down to YOUR ability to articulate to law enforcement and very likely the Court that you were in fear of death or serious bodily injury,” he wrote, according to the Reuters news service.

And in 2008, Gelhaus wrote an article for S.W.A.T. magazine in which he encouraged officers in an ambush not to “shut down,” the Chronicle reported.

“Today is the day you may need to kill someone in order to go home,” Gelhaus wrote. “If you cannot turn on the ‘mean gene’ for yourself, who will? If you find yourself in an ambush, in the kill zone, you need to turn on that mean gene.”

Reuters and The Associated Press contributed to this report.

This story was originally published on