The boy, identified by his father as Andy Lopez, was on his way to a friend's house in Santa Rosa on Tuesday afternoon, carrying the pellet gun designed to resemble an AK-47 automatic weapon. It had been left at his house earlier by another boy.
The gun uses compressed air to fire small round metal balls.
The Sonoma County Sheriff's Department said in a statement that deputies had shot and killed "an unidentified male" carrying a replica of an assault weapon.
Residents of Santa Rosa, a city of about 170,000 people, were shaken by the boy's death. Many left candles, teddy bears and flowers at the edge of the overgrown field where the boy was shot.
Some questioned whether deputies acted appropriately when they decided to fire on such a young person.
"I'm sure you can tell he's a 13-year-old boy," Abrey Martin told KGO-TV. "He's not some maniac."
Officers put on leave
The sheriff's department said the deputies involved had been patrolling in Santa Rosa on Tuesday afternoon when they saw someone who appeared to be holding an assault weapon.
"The two deputies repeatedly ordered the subject to drop the rifle and at some point immediately thereafter, the deputies fired several rounds from their handguns at the subject striking him several times," the department said in a release.
"The subject fell to the ground and landed on top of the rifle he was carrying."
After securing the area, deputies realized that the weapon was a replica, the release said. They also found a plastic handgun.
The officers involved have been placed on administrative leave, which is standard procedure, and the incident is being investigated by the Santa Rosa Police Department and other law enforcement agencies, officials said.
Andy was a Grade 8 student who played in his school band and was described as bright and popular.
"Andy was a very loved student, a very popular, very handsome young man, very smart and capable," Lawrence Cook Middle School assistant principal Linsey Gannon said Wednesday. "Our community has been rocked by his loss."
Father called friend's home
Other reports, citing his father Rodrigo, said Andy had been expelled from Lawrence Cook Middle School "for little things."
On Tuesday, Andy had been sent home early from his new alternative school, for what his parents described as lingering too long at a local store during a break.
When Andy didn't return home later in the day, the family called his friend Luis Diaz's home and learned that he had not arrived there.
Rodrigo Lopez said he then stepped outside, noting the police cars and commotion, but not realizing for some time that the body on the ground was that of his son.
Santa Rosa is about 80 kilometres north of San Francisco, west of the Sonoma and Napa wine-producing valleys.
Also on HuffPost