Annalyse Hurd, left, and Olivia Hutton, center, pray at the First Free Methodist Church after a shooting at Seattle Pacific University on Thursday, June 5, 2014. A man that shot students was disarmed by others at the scene.

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 the gunman 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 told authorities 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.

Friends credited Meis with saving lives.

"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. He is on suicide watch at the jail.

"He is cognizant of the suffering of the victims and their families and the entire Seattle Pacific community," Brandes 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, was in the building when the violence broke out. He said Meis is getting married this summer and has accepted a job with Boeing, where he has interned in previous years.

"I was amazed that he was willing to risk all that for us," Kukhotskiy said. "If Jon didn't stop him, what's to say? I could have been the next victim."

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 to pay their respects at a makeshift memorial near the science and engineering building where the shooting occurred.

The gunman had just entered Otto Miller Hall when he opened fire in the foyer. Classes were taking place upstairs.

On Friday, Ybarra wore a protective vest at his appearance in a jailhouse courtroom. A judge found probable cause to keep him detained without bail at the King County Jail.

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

In 2010, officers responded after Ybarra, heavily intoxicated, called 911 to report that he "had a rage inside him" and wanted to hurt himself and others, according to a report released by Mountlake Terrace police.

In 2012, police found Ybarra lying in a roadway, again severely intoxicated. He told officers he wanted a SWAT team "to get him and make him famous," a police report said.

Both times, police took Ybarra to Swedish Hospital in Edmonds for evaluation, Caw said.

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

Ybarra's family said in a statement they were shocked and saddened by the shootings.

"We are crushed at the amount of pain caused to so many people," the statement said. "To the victims and their families, our prayers are with you."

Ybarra is not a Seattle Pacific student, police said. His friend Zack McKinley described him as "super happy and friendly," The Seattle Times reported.

McKinley said the attack was puzzling because Ybarra was happy to have just started a job bagging groceries. Ybarra could get emotionally low but had a good group of friends, McKinley said.

Late Thursday, investigators searched a Mountlake Terrace house believed to be tied to Ybarra.