A nine-year-old boy has appeared in a US juvenile court accused of accidentally shooting a classmate.

Court documents say the gun went off after the boy slammed his backpack down on a desk. The victim, eight-year-old Amina Kocer-Bowman, remains in critical condition.

The boy sat in court, crying and wearing an orange jail jumpsuit, as his father gently rubbed his back.

The scene in Washington state raised questions the court must decide: Did the boy know what he did was wrong? And is anyone else responsible?

The boy was charged with unlawful possession of a gun, bringing a dangerous weapon to school and third-degree assault. Bail was set at 50,000 dollars (£31,600).

Ultimately, the court will determine whether the case against the boy will continue. He will not be arraigned until the court determines whether he has the capacity to understand that what he did was wrong.

"I just want everyone to know that my kid made a mistake. It was a terrible mistake," the boy's father, Jason Cochran, said outside the courthouse.

Authorities say the boy brought a .45-calibre handgun he got from his mother's house, and the weapon discharged just before classes let out.

The charging documents say the boy had told a classmate that he was going to bring his "dad's gun" to school and run away.

The teacher, Natalie Poss, said the shooting was "a teacher's worst nightmare." She recalled hearing a loud bang, then seeing the girl slump.

Under state law, children between eight and 12 years old can face charges if a court determines he or she has the capacity to understand that what he or she did was wrong.

"He has a lot of good in his heart," the boy's teacher said. "I know he didn't intend this to happen. And I know he's hurting tonight."

Gail Hammer, a law professor at Gonzaga University, said it is very rare for a child as young as nine to be charged with a crime. Even if a young child is convicted, he would not be sent to an adult prison.

In 27 US states, there are some kind of firearm child access prevention laws. Such laws can include criminal penalties for adults who allow children to get their hands on guns, but Washington has no such laws, according to the San Francisco-based Legal Community Against Violence.

Past shootings at US schools have involved younger children. In 2000, six-year-old Kayla Rolland was fatally shot by a six-year-old classmate in Michigan who brought a gun from home. That boy was not criminally charged; prosecutors said he was too young to be held responsible.

Last year, a six-year-old at a Houston primary school accidentally fired a gun as he was showing it off to friends, injuring three students.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.