ABBOTSFORD, B.C. -- Grade 9 student Amsuman Nair will remember the screams for the rest of his life.

The 14-year-old was in the middle of a math exam at his high school in Abbotsford, B.C., when two girls were stabbed, one fatally, in the building's front entrance -- an attack police have characterized as "random."

Nair and his classmates spent four hours on Tuesday afternoon crouched silently in the corner of a classroom after a school-wide lockdown was declared over the intercom.

On Wednesday, he stood with his father outside the building, where a memorial of cards, flowers, notes and candles was growing.

"They used to be happy and always dancing around, having fun," Nair said of his friends. "But one of them is gone and it's hard to believe."

Sgt. Jennifer Pound of the Integrated Homicide Investigation Team said Gabriel Klein, a 21-year-old homeless man, has been charged with second-degree murder in the death of the 13-year-old student and aggravated assault in the attack on the 14-year-old.

"Evidence suggests this attack was random," Pound said. "We do not believe the suspect has ties to the school, to the two girls, or to the Abbotsford community."

Police and school district officials said a barefoot man walked into Abbotsford Senior Secondary School on Tuesday and attacked the girls before staff confronted and restrained him.

While police haven't named the stabbing victim, several students have identified the girl who died as Letisha Reimer.

Grade 11 student Hannah Bartolome, who started the memorial, said she no longer feels safe in her school.

"It's tragic," she said, her eyes red and puffy. "Before the alarms went off all I heard was the screaming."

But Daniel Glencroff, a 15-year-old who is also in Grade 11, said he feels "extraordinarily safe" at the school. He praised the teachers for stepping in when they did, adding that the situation could have been a lot worse were it not for them.

"They apprehended the guy and stopped this from being a rampage. (Credit) to them," Glencroff said outside the school, which has been cordoned off with yellow police tape.

"I think the staff did a tremendous job and they should get a medal for bravery or something."

Klein appeared in court on Wednesday and is expected to return for a hearing on Nov. 7.

Condolences poured in on social media including Letisha's own Facebook page, while her father, Ulrich Reimer, updated his profile picture with a selfie of himself and his daughter by a river.

Police said they knew little about the accused, who has no criminal past and no fixed address.

Pound said it's believed that Klein was from Alberta and she made a plea to anyone who may know him to call police.

"Until we can learn a little bit more on who this individual is, we're not going to have a definitive (answer) on what that motive looks like."

Pound said the selfless actions of school staff who confronted the man likely prevented more people from being injured.

Abbotsford school district Supt. Kevin Godden also praised the school's staff for their actions.

"What I will say was in the middle of this horrific situation they stopped this individual, first by just yelling at him, and then the staff converged on him and got him," Godden said.

"The knife fell from his hands and they got him to take a seat while they held him in some restraint and then provided first aid to the students, who were obviously hurt."

Every school in the Abbotsford district locked all but one door on Wednesday, in what Godden called a precautionary measure.

A video of the stabbing has been circulating on the Internet and Godden asked for people to stop sharing it, a sentiment echoed by police.

The video, apparently taken from the second floor overlooking the school's atrium, shows a man in a grey T-shirt standing over a girl and frantically stabbing at her as she screams on the floor. A person in an apron then approaches the man, who suddenly drops his weapon and backs away.

Godden said there was nothing to stop the man from walking into the school.

"Our schools are closed campuses to the extent that we keep our kids in and have lots of adult supervision," he said. "But there is nothing that would preclude any stranger from walking into school."

Premier Christy Clark offered her condolences to the families of the victims at a news conference, saying she was shocked by the incident.

"Schools are very safe places in British Columbia, but the fact that this kind of thing can happen ruptures our sense of security."