Without the heroic actions of a social studies teacher, a school shooting in Roswell, New Mexico could have turned out much worse.

When a 12-year-old gunman opened fire at Berrendo Middle School Tuesday, police say a teacher walked right up to him and convinced him to put the gun down.

A local report identified that teacher as John Masterson. He was joined in his effort by an off-duty police officer who was dropping his child off at school when the shots rang out.

New Mexico Gov. Susana Martinez said late Tuesday that a 12-year-old boy wounded in the shooting had underwent two surgeries.

A 13-year-old girl who was also wounded is in stable condition, the governor said. 

The shooter reportedly used a sawed-off 20-gauge shotgun that he snuck into school in a bag or musical instrument case.

After being taken into custody, the suspect was transferred to a psychiatric facility following a hearing.

Watch the latest report from Will Carr on America's Newsroom, including on reported warnings issued by the gunmen to other students.

LOL: ‘Devil Baby’ Terrifies New Yorkers in Prank Video

What!? Bears Fan Uses Stun Gun on Wife as Part of NFL Bet