The suspect was booked into a juvenile detention center in Seattle for investigation of assault with a firearm and reckless endangerment, prosecutor's spokesman Dan Donohoe said. The teen also may be charged with unlawful possession of a firearm.
He surrendered to authorities at his grandparents' house Tuesday, a day after the shooting.
No one was injured in the Monday shooting at nearby Dimmitt Middle School, but the boy remained at large after the incident. Classes were canceled until Thursday although the school planned to have counselors available Wednesday.
The boy spent Monday night "hunkered down in woods" near his grandparents' home 10 miles south of Seattle, King County sheriff's spokesman John Urquhart said. His mother notified authorities that her son wanted to turn himself in, and he was arrested peacefully at his grandparents' house.
"Right now it's every police officer's nightmare kids with guns in school," Urquhart said, noting the gun was pointed in a girl's face during the incident. "This worked out OK this time, because they all got out of the building and no one was hurt."
The suspect was booked into a juvenile detention center in Seattle for investigation of assault with a firearm and reckless endangerment, prosecutor's spokesman Dan Donohoe said.
The boy also may be charged with unlawful possession of a firearm, Donohoe said. The boy's initial court hearing was scheduled for Wednesday, and prosecutors were requesting that he be held until then.
The suspect led sheriff's deputies Tuesday to the spot in the woods where he had left the .22-caliber handgun allegedly used Monday, Urquhart said. The handgun was believed to have been taken from the grandparents' home, he said.
The boy was described Monday as dressed in black, with blond hair dyed blue at the ends. But on Tuesday, his blond hair was cut short with no dye evident.
Deputies seized as evidence a note the boy had written to friends before the incident saying he would not be back home and that he loved his family, family members said.
"He's never had any problems with cops or anything," his grandmother told KOMO-TV. "He's a good kid, just flunking school."
"I'm glad that nobody got hurt, and I'm sorry it happened," added her husband.
District officials had stepped up evacuation drills for students recently, in part because of highly publicized school shootings such as the one at Columbine High School in Colorado last year.
Students said the suspect threatened classmates and talked about shooting a teacher and committing suicide afterward
Urquhart said the boy got on a table and shot a round into the ceiling. He ordered students t get on the stage in the cafeteria, but they scattered and ran, authorities said.
"He and about 10 other kids dyed their hair blue," said Tori Ford, 16. "Everyone didn't pay that much attention to them. They seemed kind of ratty and wore trench coats."
Cylas Sampson, 13, said the boy had shown him a gun and a large knife at the beginning of the school day.
"I didn't think he was going to do anything," Sampson said. "I thought it was a fake gun."
"He said, 'You don't have to worry about school anymore. Today's your last day of school,"' Sampson said.
Sampson and other students said the boy frequently talked about wanting to kill a particular teacher. Several students said they had heard there was going to be a shooting last Friday.
"He wanted to kill all the teachers, but he only wanted to kill a few students," Sampson said.
Brittany Lamb, 14, was sitting at the same table as the armed youth when he stood up and fired the shot. She said she was too scared to move, and he threatened her directly.
"He put the gun right up to my face and he said, 'I'm going to kill you if you don't get up on the stage.' I was frozen. I could not move at all," Lamb said.
At that point a teacher shouted that police were coming and the boy swore and ran, Lamb said.
"When I knew him he wasn't really that bad. This just sort of happened over the past couple weeks," she said. He "went gothic or something."
She said that he had been talking about shooting a teacher for at least a couple of days and had told other pupils he was going to commit suicide before the police got him.
"My friends and I didn't really think he'd do that," Lamb said. "A lot of people knew he was talking about it, but they didn't say anything because they didn't think he would really do it. People say dumb stuff like that all the time."