NOBLESVILLE, Ind. — An Indiana middle school student armed with two handguns opened fire inside his science classroom, authorities said, wounding a classmate and a teacher whose swift intervention was credited with saving lives.

The teacher, Jason Seaman, 29, of Noblesville, was in good condition Friday night, police spokesman Lt. Bruce Barnes said. The injured student, a girl, was in critical condition, Barnes said. Her name has not been released.

“There were no apparent injuries to the alleged shooter,” Barnes said in a news release.

The shooter, who had asked to be dismissed from the class before returning with the guns, was arrested “extremely quickly” after the incident around 9 a.m. Friday at Noblesville West Middle School, police Chief Kevin Jowitt said. Authorities didn’t release his name or say whether he had been in trouble before but indicated he likely acted alone.

Seventh-grader Ethan Stonebraker said the student was acting suspiciously when he walked into the room while the class was taking a test. He said Seaman likely averted a catastrophe.

“Our science teacher immediately ran at him, swatted a gun out of his hand and tackled him to the ground,” Stonebraker said. “If it weren’t for him, more of us would have been injured for sure.”

Stonebraker told ABC News that Seaman threw a basketball at the shooter and ran toward the bullets as screaming students sought cover behind a table.

He said he also knew the suspected gunman, whom he described as “a nice kid most of the times” and said he often joked with the classmates.

“It’s just a shock he would do something like that,” Stonebraker said.

The attack comes a week after an attack at a high school in Santa Fe, Texas, that killed eight students and two teachers, and months after the school attack that killed 17 people in Parkland, Florida. The Florida attack inspired students from that school and others throughout the country to call for more restrictions on access to guns.

Seaman’s brother, Jeremy Seaman, told The Indianapolis Star that his brother was shot three times and was undergoing surgery. He said he was conscious after the shooting and talked with his wife, telling her he was OK.

Jeremy Seaman, who now lives in Arizona, said his brother was a defensive end for Southern Illinois University’s football team and has never been a person to run away.

Hours after the shooting, law enforcement agents sealed off part of an upscale neighborhood in Noblesville but weren’t commenting on whether the suspect lived there. Sandy McWilliams, a member of a landscaping crew working nearby, said six officers toting assault rifles entered a home.

Students were bused to the Noblesville High School gym, where hundreds of parents and other family members arrived to retrieve them.

Authorities referred to a prompt and heroic response at the school but didn’t confirm accounts of the teacher tackling the student or describe the role of the resource officer who was stationed at the school.

When asked to elaborate on his praise of the response, Indiana State Police Superintendent Doug Carter said: “Wait ’til one day we can tell you that story. You’ll be proud of them, too.”

Eighth-grader Chris Navarro said he was inside an auditorium when he heard several gunshots about a minute before the bell rang for the change in classes.

“The speaker came on and said we were on lockdown and people rushed in and we went to the back of the room. I went into this little room in the back with three other people,” he said calmly standing between his parents as they picked him up.

Jennifer Morris, who was among the worried parents who rushed to get their kids, appeared slightly dazed and said she was at work when her 14-year-old son sent a text message about the shooting, stunning her.

“He said, ‘I’m OK, please come get me.’ That was probably 20 minutes after it happened,” Morris said. “It’s like a bad dream. I don’t know how you get the kids through this. This isn’t something you’re trained for as a parent.”

Gov. Eric Holcomb, who was returning from a trip to Europe on Friday, issued a statement saying he and other state leaders were getting updates about the situation and that 100 state police officers had been made available to work with local law enforcement.

“Our thoughts are with all those affected by this horrible situation,” Holcomb said.

Noblesville, which is about 20 miles (32 kilometers) northeast of Indianapolis, is home to about 50,000 people. The middle school has about 1,300 students from grades 6-8. The school’s academic year was scheduled to end next Friday.

Indiana’s Senate Democrats issued a statement in response to Friday’s school shooting expressing their condolences to the victims and calling for steps to prevent such shootings, including restrictions on guns.