A 9-year-old Washington boy, who accidently shot his 8-year-old classmate in an Armin Jahr Elementary school, wrote an apology to her as she left hospital Tuesday.

The letter was written as part of a court ordered mandate and was addressed to Amina Bowman who was critically injured.

Bowman, third-grader, had five surgeries after the bullet hit in her spine. She was discharged after six weeks Tuesday afternoon from Harborview Medical Center in Seattle, Washington.

I'm sorry I hurt you because I brought a gun to school, the boy wrote in the letter. I did not mean for anyone to get hurt. I wish you were out of the hospital paying basketball and going back to school.

I made a bad choice. I will stay away from guns, the boy wrote. I should have told a grown-up.

The boy took the 45-caliber handgun from his mother's house and brought it to the elementary school in a backpack.

His mother, Jamie Lee Chaffin, and her boyfriend, Douglas L. Bauer, pleaded not guilty to third-degree assault and unlawful possession of a firearm, according to ABC affiliate KOMO.

School staff and officers discovered a large-caliber semiautomatic handgun in the boy's backpack, according to court documents.

At the end of the school day, the firearm discharged while in his backpack. A bullet went through the backpack, striking Bowman. At this stage of the investigation, detectives believe the shooting was accidental, the police said in a statement.

According to the charging documents, one student told officers the boy had planned to bring his dad's gun to school and run away.

Another student said that the boy brought the gun for protection, the documents said.

I was sad, scared and afraid and I did not solve my problem well, the boy wrote.