A teenager was shot to death in a high school hallway Wednesday as classes were about to resume after the winter break, and police arrested a fellow student found wandering a neighborhood a few blocks away, authorities said.

Police were trying to determine what prompted the shooting.

Witnesses said the gunman fired three shots at point-blank range, splattering blood on lockers at Foss High School and setting off panic. He did not appear to be aiming at anyone other than the victim.

• Crack the case in FOXNews.com's Crime Center.

The victim "got shot — bang — and he just fell," said sophomore Malcolm Clark. "He just froze and he fell backwards into the lockers."

The teenager suspected in the shooting was caught without incident about two hours later in a suburban area dotted with homes and shopping centers.

Douglas Chanthabouly, 18, was booked for investigation of first-degree murder. Police said he had no criminal record.

The suspected shooter and victim were acquainted, but detectives did not know a motive. Police Chief Donald Ramsdell said Chanthabouly was being cooperative. It was not immediately known if he had a lawyer.

Freshman Sam Sao, 14, said she was in the lunchroom, waiting for the bell to ring, when the shots were heard about 7:30 a.m.

"Everyone was yelling, `Get in the gym! Get in the gym!"' she said. "At first we thought it was a fight. Then the teachers started getting on the tables and screaming."

An armed school officer was on the scene within seconds and radioed police for help as teachers herded students into classrooms and the gymnasium, said Detective Chris Taylor. Three teams of about six officers, each armed with rifles, swept the school to ensure the gunman had left.

"Today we lost a nice young person in a Tacoma public school in an act of senseless violence," Ramsdell said. He said police would work with the school district to prevent future attacks.

Principal Don Herbert was only 20 feet away when the shooting happened.

"The only thing I could have done was taken the shot instead. But it happened very fast," he said.

Student Jacki Phongsavath told Seattle television station KOMO that he was in a nearby hallway when he heard the gunfire. "I thought it was fireworks," Phongsavath said. "I looked around the corner and saw someone laying on the ground and blood on the lockers."

The medical examiner's office identified the victim as Samnang Kok, 17.

Kok's sister, Lisa, told television station KING in Seattle that he was the father of a 2-year-old boy. The boy "would always ask for his dad," she said. "I don't know what to tell him when he says that."

The school was locked down after the shooting. Classes were canceled for the rest of the day and students sent home about an hour later.

Angela Millette was among the parents who rushed to pick up children from a nearby grocery store parking lot. Millette, who did not have time to change out of her pajamas after hearing about the shooting, threw her arms around daughter Ashley, 16.

"I was looking for her and finally, by the grace of God, the person opened up the school bus, and there's my daughter," Millette said. "I was so glad to see that she was OK."

Visit FOXNews.com's Crime Center for complete coverage.