The man blasting away with a shotgun paused to reload, and Jon Meis saw his chance.

The 22-year-old building monitor pepper-sprayed and tackled the gunman Thursday in Seattle Pacific University’s Otto Miller Hall, likely preventing further carnage, according to police and university officials.

Meis and other students subdued him until officers arrived and handcuffed him moments later.

Police said the shooter, who killed a 19-year-old man and wounded two other young people, had 50 additional shotgun shells and a hunting knife. He admitted after his arrest that he wanted to kill as many people as possible before taking his own life, Seattle police wrote in a statement filed in court Friday.

“I’m proud of the selfless actions that my roommate, Jon Meis, showed today taking down the shooter,” fellow student Matt Garcia wrote on Twitter. “He is a hero.”

The suspect, 26-year-old Aaron R. Ybarra, has a long history of mental health problems for which he had been treated and medicated, said his attorney, public defender Ramona Brandes. Ybarra is on suicide watch at the jail, she said.

“He is cognizant of the suffering of the victims and their families and the entire Seattle Pacific community,” she said. “He is sorry.”

Meis, a dean’s list electrical engineering student, was emotionally anguished but not injured in the shooting, Harborview Medical Center spokeswoman Susan Gregg said Friday. He was treated there and released.

Roman Kukhotskiy, 22, who was in the building when the violence broke out, said: “I was amazed that he was willing to risk all that for us. If Jon didn’t stop him, what’s to say? I could have been the next victim.”

He said Meis is getting married this summer and has accepted a job with Boeing, where he has interned in previous years.

The leafy campus of the private, Christian university about 10 minutes north of downtown Seattle was quiet the morning after the shooting, with a service held at midday. People stopped by a makeshift memorial near Otto Miller Hall to pay their respects.

Seattle Mayor Ed Murray identified the student killed as Paul Lee, a “Korean-American student with a bright future.”

The gunman had just entered the science and engineering building when he opened fire in the foyer. Classes were taking place upstairs.

Ybarra was booked into the King County Jail and appeared, wearing a protective vest, in a jailhouse courtroom Friday. A judge found probable cause to detain him without bail.

Ybarra was hospitalized for mental health evaluations twice in recent years, said Pete Caw, assistant police chief in Ybarra’s hometown, the Seattle suburb of Mountlake Terrace.

Officers encountered Ybarra in 2010 and 2012. Both times, he was severely intoxicated and taken to Swedish Hospital in Edmonds for evaluation, Caw said. In the October 2012 incident, police found Ybarra lying in a roadway.

He was arrested on suspicion of DUI in nearby Edmonds in 2012, said Edmonds police Sgt. Mark Marsh.

“We are so very shocked and sad over yesterday’s shootings at SPU,” Ybarra’s family said in a statement. “We are crushed at the amount of pain caused to so many people. To the victims and their families, our prayers are with you.”

Ybarra is not a student at the school, police said.

(story can end here)

Meis, who graduated from Seattle Christian Schools in SeaTac, kept a low profile the day after the shooting. An outgoing voice message at a phone listing for his parents’ home in Renton said: “We ask that you please respect our privacy during this time while we recover.” It solicited prayers for students and the family of the man killed.

Salomon Meza Tapia, a friend who serves with Meis on the board of a student engineers group, described him as a hardworking student who is “always super chill.”

“I am not surprised he was cool and collected enough to take action,” he wrote in an email. “I was in the building, and I can say he definitely saved our lives. I am thankful to be alive and thank God for Jon Meis’ courage and actions.”