Police say an 8-year-old girl critically wounded by a gunshot at her elementary school near Seattle apparently was shot accidentally.

Bremerton, Wash., police Lt. Peter Fisher says a gun brought to the school Wednesday discharged while still in a third-grade boy's backpack. Fisher says the bullet hit the nearby girl.

The injured third-grader was airlifted to Seattle's Harborview Medical Center, where she underwent surgery Wednesday afternoon so doctors could assess her injuries, hospital spokeswoman Susan Gregg said.

Fisher says the student who brought the gun to Armin Jahr Elementary has been booked into juvenile detention for investigation of unlawful possession of a gun, bringing a dangerous weapon to school and third-degree assault.

Police are trying to determine how the child got the gun.

The school is in a quiet residential neighborhood about 20 miles west of Seattle, across Puget Sound.

The school went into lockdown immediately after the shooting, said Bremerton Schools spokeswoman Patty Glaser. Lockdown procedures call for announcements to be made over the school's loudspeakers and for teachers to lock their classrooms, she said.

Armin Jahr Elementary has about 400 students, Glaser said. She said the school will reopen Thursday and three counselors will talk to teachers, students and parents.

"Our plans at this time, school will continue as usual," Glaser said.

When asked how a gun was brought into the school, Fisher said police were still investigating the circumstances and couldn't provide details.

Police were working with the school district Wednesday afternoon to reunite parents with their children, Fisher added, and investigators were interviewing witnesses, which included students.

As of mid-afternoon, parents were still arriving to pick up their children from the school. A police officer was checking vehicles as they entered the parking lot.

Many questions remained, including how a child could have obtained a loaded weapon and brought it into a grade school classroom.

In the latest scorecard by the Brady Campaign, a national gun control advocacy group, Washington scored no points in the child safety category because the state does not require trigger locks for guns and lacks laws to prevent child access to firearms.

"Washington state is a loosely regulated state when it comes to firearms," said Gregory Roberts, executive director of Washington Cease Fire, a Brady Campaign affiliate.