A Northern California man killed two neighbours with whom he had been feuding before he went on a shooting rampage at apparent random sites -including an elementary school, officials have said.

Two more people were killed and 10 injured before police fatally shot him.

Police said surveillance video shows the shooter unsuccessfully trying to enter a nearby elementary school after quick-thinking staff members locked the outside doors and barricaded themselves inside when they heard gunshots.

Tehama County Assistant Sheriff Phil Johnston said the gunman spent about six minutes shooting into Rancho Tehama Elementary School before driving off to continue shooting elsewhere. Mr Johnston said one student was shot and injured and is expected to survive.

"It was a bizarre and murderous rampage," Mr Johnston said.

He said the 45-minute spree ended when a patrol car rammed the stolen vehicle the shooter was driving and killed him in a shootout. Mr Johnston said the shooter was facing charges of assaulting one of the feuding neighbours in January and that she had a restraining order against him.

"I think the motive of getting even with his neighbours and when it went that far - he just went on a rampage," Mr Johnston said. He said there was a "domestic violence" report on Monday involving the gunman, but did not provide any further details.

At least one of the victims has life-threatening injuries, he said.

Mr Johnston declined to identify the shooter until his relatives were notified, but he confirmed the gunman was charged with assault in January and had a restraining order placed against him. The district attorney, Gregg Cohen, told the Sacramento Bee he is prosecuting a man named Kevin Neal in that case.

Neal's mother told The Associated Press he was in a long-running dispute with neighbours he believed were cooking methamphetamine.

The mother, who spoke on condition she be named only as Anne, lives in Raleigh, North Carolina, where she raised Neal. She said she posted his 160,000 dollars bail and spent 10,000 dollars on a lawyer after he was arrested in January for stabbing a neighbour. Neal's mother said the neighbour was slightly cut after Neal grabbed a steak knife out of the hand of the neighbour who was threatening him with it.

She wept as she told The Associated Press she spoke to Neal on the phone on Monday.

"Mom it's all over now," she said he told her. "I have done everything I could do and I am fighting against everyone who lives in this area."

She said Neal apologised to her during their brief conversation, she thought for all the money she had spent.

He also told her that "Mom you know what, my whole life you gave me such a good happy life and nobody could have a better mother than I had."

Then he said: "All of a sudden, now I'm on a cliff and there's nowhere to go. No matter where I go for help here I get nobody who will help me. All they are doing is trying to execute me here."

Neal's sister, Sheridan Orr, said the family was trying to reach the sheriff's department on Tuesday evening but still had not been notified. She said her brother had struggled with mental illness throughout his life and at times had a violent temper.

"We're stunned and we're appalled that this is a person who has no business with firearms whatsoever," Ms Orr said. "Our deep, deep sympathy for the victims and it sounds trite but our hearts are breaking for them."

Mr Johnston said officials received multiple 911 calls about gunfire at an intersection of two dirt roads. Minutes later, more calls reporting shots flooded in from different locations, including the school.

Witnesses reported hearing gunshots and children screaming at the school, which has one class of students from kindergarten through fifth grade.

Mr Johnston said the shooter was armed with a semiautomatic rifle and two handguns at seven locations. He said another weapon was seen in one of the vehicles he drove but had not been recovered yet.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.