SPARKS, Nev. -- A middle-school student opened fire on campus just before the starting bell Monday, wounding two boys and killing a teacher who was trying to protect other children, Sparks police and the victim's family said.

Twenty to thirty students, most of them 12- and 13-year-olds, witnessed the tragedy at Sparks Middle School that also left the lone suspected gunman dead, police said.

It's unclear whether the student committed suicide, but authorities say no shots were fired by law enforcement. Police said between 150 and 200 officers, including some from as far as 60 miles (96 kilometres) away, responded to the shooting.

"In my estimation, he is a hero. ... We do know he was trying to intervene," Reno Deputy Police Chief Tom Robinson said of the teacher who was killed, who initially was identified only as a staff member.

Family members identified him as math teacher Michael Landsberry, a 45-year-old military veteran who leaves behind a wife and two stepdaughters.

"To hear that he was trying to stop that is not surprising by any means," said his sister-in-law Chanda Landsberry. She added his life could be summed up by his love of family, his students and his country.

On his school website, Michael Landsberry posted a picture of a brown bear and took on a tough-love tone, telling students, "I have one classroom rule and it is very simple: 'Thou Shall Not Annoy Mr. L."'

"The kids loved him," Chanda Landsberry said.

The names of the suspect and two other victims have not yet been released, and the motive for the shooting is still unknown.

"As you can imagine, the best description is chaos," Robinson said. "It's too early to say whether he was targeting people or going on an indiscriminate shooting spree."

Students from the middle school and neighbouring elementary school were evacuated to the nearby high school, and classes were cancelled. The middle school will remain closed for the week.

At the evacuation centre, parents comforted their children.

"We came flying down here to get our kids," said Mike Fiorica, whose nephew attends the school. "... It's really chaotic. You can imagine how parents are feeling. You don't know if your kid's OK."

One of the students injured in the violence that erupted around 7:15 a.m. is out of surgery and the other is doing well, according to police.

The shooting happened on the school's campus and ended outside the school building itself, according to police.

"I was deeply saddened to learn of the horrific shooting at Sparks Middle School this morning," Nevada Gov. Brian Sandoval said in a statement extending his thoughts and prayers to those affected.

About 700 students in 7th and 8th grades are enrolled at the school, located in a working class neighbourhood.

"It's not supposed to happen here," Chanda Landsberry said. "We're just Sparks -- little Sparks, Nevada. It's unreal."

Democratic Senate Majority Leader Harry Reid, of Nevada, offered his condolences to those who experienced a "traumatic morning."

"No words of condolence could possibly ease the pain, but I hope it is some small comfort that Nevada mourns with them," Reid said in a statement.

The violence erupted nearly a year after a gunman horrified the nation by opening fire in Sandy Hook Elementary School in Newtown, Connecticut, leaving 26 dead. The Dec. 14 shooting ignited debate over how best to protect the nation's schools and whether armed teachers should be part of that equation.

In a statement on the website of Sandy Hook Promise, a gun control advocacy group, Nicole Hockley, whose son Dylan was killed in the shooting, said: "It's moments like this that demand that we unite as parents to find commonsense solutions that keep our children -- all children -- safe, and prevent these tragedies from happening again and again."

The Washoe County School District held a session in the spring in light of the Connecticut tragedy to educate parents on what safety measures the district takes.

Sparks, a city of roughly 90,000 that sprung out of the railway industry, lies just east of Reno.

Mayor Geno Martini spoke at a morning news conference to assure residents that the community was safe.

"It's a tragic day in the city of Sparks," he said. "This is just an isolated incident."