Media playback is unsupported on your device Media caption "The deputies said they repeatedly ordered him to drop the rifle", reports Alastair Leithead

A 13-year-old boy carrying a replica assault rifle has been shot dead by police in the US state of California.

Officers in the city of Santa Rosa say they opened fire after the boy refused orders to drop the rifle, which they believed to be real.

The shooting on Tuesday is now being investigated.

It comes a day after a 12-year-old boy in Nevada shot dead a maths teacher at his school and wounded two fellow pupils before taking his own life.

In the latest incident, two sheriff's deputies saw the teenager "with what appeared to be some type of rifle", a news release from the Sonoma County Sheriff's office said.

The deputies called for backup and repeatedly ordered the boy to drop the gun before firing several rounds from their handguns, police said.

Image caption Witnesses in Santa Rosa said they heard several shots

The boy, who was pronounced dead at the scene, was later identified by his family as Andy Lopez.

"He was holding the weapon in his left hand. He began to turn toward his right in the direction of the deputy, and in so doing he moved the gun toward the deputy, and the deputy's mindset was that he was fearful he would be shot," Lt Paul Henry of Santa Rosa police said.

But the boy's father, Rodrigo Lopez said the shooting made no sense. "My son lost his life. He's not alive any more just because of the mistake of somebody."

The replica gun had belonged to a friend, he said.

The sheriff's office said a plastic handgun had also been found in the boy's waistband.

Witness Brian Zastrow told the Santa Rosa Press Democrat he heard seven shots.

"First, I heard a single siren and within seconds I heard seven shots go off, sounded like a nail gun," he said.

One man who saw the events unfold said the shooting was over in an instant.

"He pulled over to the kid walking and he just opened the door and shot him, three shots," Ismael Mondragon told KGO-TV.

Police Lt Dennis O'Leary said the deputies had been placed on administrative leave pending the inquiry.

Sheriff Steve Freitas described the shooting as a "tragedy" and promised the investigation would be thorough and transparent.

"As a father of two boys about this age, I can't begin to imagine the grief this family is going through," he said.

A spokeswoman for the boy's school described him as "a very loved student, a very popular, very handsome young man, very smart and capable".

Image caption The replica gun resembled an AK-47, experts said

Linsey Gannon, assistant principal at Lawrence Cook Middle School, said he played trumpet in the school band.

"Our community has been rocked by his loss," she said.

Candles, teddy bears and flowers have since been left at the scene of the shooting.

"He was a good kid, he was 13 years old. He didn't look like a man, Andy, he was a boy," one friend told local media.

On Monday, a 12-year-old boy who has not been named opened fire at a school in Sparks, Nevada, killing maths teacher and Afghanistan veteran Michael Landsberry.

Police said Mr Landsberry had tried to coax the boy to drop the gun, enabling children in the playground to flee.

The boy then shot and injured two fellow pupils, before taking his own life on the outdoor basketball court.

President Barack Obama has recently renewed calls for changes to US gun laws following a series of deadly shootings. However, the BBC's Alastair Leithead in Los Angeles says the proposals face fierce resistance.