The 12-year-old student who opened fire on a middle school campus, wounding two classmates and killing a teacher before he turned the gun on himself, got the weapon from his home, authorities said Tuesday.

School District police said they are still working to determine how the boy obtained the 9mm semi-automatic Ruger handgun used in the Monday morning spree at Sparks Middle School. The boy’s parents are cooperating with authorities and could face charges in the case, police said.

Authorities say they are withholding the seventh-grader’s name out of respect for his family.

At a news conference Tuesday, law enforcement and school officials again lauded the actions of 45-year-old math teacher and former Marine Michael Landsberry, who tried to stop the rampage before he was killed.

“I cannot express enough appreciation for Mr. Landsberry,” School District Superintendent Pedro Martinez said. “He truly is a hero.”

The violence started before the first bell of the day rang, as students filed off buses and gathered for class. The boy opened fire outside a school building, hitting one 12-year-old student in the shoulder. He then headed toward a basketball court, where he encountered Landsberry.

The teacher walked calmly toward the shooter and lifted his hands, asking the boy to hand over his weapon.

“He was telling him to stop and put the gun down,” student Jose Cazares told NBC’s “Today” show Tuesday. “Then the kid, he yelled out ‘No!’ Like, he was yelling at him, and he shot him.”

Landsberry suffered a fatal gunshot wound to the chest, yet his actions gave students enough time to run to safety, according to Washoe County School District Police Chief Mike Mieras.

Police said they believe the shooter at one point tried to enter the school but couldn’t open the door because of emergency lockdown procedures.

After killing Landsberry, the boy fired at a second student, hitting him in the abdomen. He then shot himself in the head.

The two 12-year-old boys who were wounded are in stable condition and recovering.

Authorities provided no motive for the shooting but said they’ve interviewed 20 or 30 witnesses and are looking into any prior connection the victims had with the shooter.

“Everybody wants to know why — that’s the big question,” Sparks Deputy Police Chief Tom Miller said. “The answer is, we don’t know right now.”

Parents clung to their children at an evacuation center shortly after the shooting while the community struggled to make sense of the latest episode of schoolyard violence, which happened less than a year after the Newtown, Conn., massacre.

Sparks, just east of Reno, has a population of roughly 90,000.

Landsberry coached several youth sports. He also served two tours in Afghanistan with the Nevada National Guard and was well-known in the school community, Mayor Geno Martini said. Landsberry served in the Marine Corps from 1986 to 1990 and was stationed in Camp Lejeune, North Carolina, and Okinawa, Japan, according to military records.

The mayor praised the response from officers, who arrived at the scene within 3 minutes of the initial emergency calls to find the shooter dead.

“They got it under control very quickly and shut down the scene,” said Martini, who urged listeners on a local radio station hours after the shooting to be sure all guns in their homes were safely locked away.

Students from the middle school and neighboring elementary school were evacuated to a high school, and all classes were canceled. The middle school will remain closed for the week, while an adjacent elementary school is set to reopen today.