Teen killed in Washington state school shooting 'tried to talk' armed classmate 'out of it': Sheriff Three other students were injured in the shooting.

 -- When a Washington state high school student confronted a classmate who was armed inside the school, authorities said the student "tried to talk" the armed classmate "out of it," but the gunman fatally shot him.

"That young man gave his life ... to save his fellow classmates," Spokane County Sheriff Ozzie Knezovich told reporters Thursday.

The shooting took place Wednesday at Freeman High School in Rockford, Washington. Three other students were injured.

According to ABC Spokane affiliate KXLY, friends and family identified the victim as a sophomore at the school.

"My heart goes out to her because she lost her husband three months ago,” Knezovich said, referring to the victim's mother.

"There’s nothing like that scream. You will never forget it," he said. "I heard it one too many times. Half her family is now gone. Partly because of senseless violence.”

The suspect -- who has since been taken into custody -- brought an AR-15 and a handgun inside the school that morning, the sheriff said.

But Knezovich said the AR-15 jammed.

"Thank God he had jammed that AR up so badly that it was not going to function," Knezovich said.

The suspect "transitioned to that pistol, and when one of the classmates that he knew came up to him and tried to talk him out of it,” the suspect fatally shot him, the sheriff said.

The suspect, who is a juvenile and is not being named by ABC News, ultimately surrendered to a janitor who ordered him to lay down on the floor, the documents said.

Knezovich said the janitor "confronted him, ordered him to the ground and held him there,” and then a school resource officer rushed in and helped the janitor take the suspect into custody.

Two of the injured students remain in the hospital in satisfactory condition and the third was discharged Thursday, the hospital said in a statement.

The families of the three injured students released a statement through the hospital, saying, "In this, our darkest hour, we feel blessed and lucky in so many ways. Our daughters are recovering from their wounds, and we know that your thoughts and prayers are with us."

They added, "Our hearts are breaking for another family in our community who lost their son."

"We wish to express our overwhelming gratitude for the outpouring of support and love you have shown our families in our time of need," the families said. "Everyone – our friends, Freeman School District, first responders, the trauma team and care providers at Providence Sacred Heart Medical Center & Children’s Hospital, the communities of Freeman and Rockford as well as Spokane – have all been phenomenal. No words can express our gratitude."

Bevan Maxey, a lawyer for the family of the suspected shooter, released a statement on behalf of the suspect’s family, which said the family "wishes to offer their deepest condolences and sympathies to the entire Freeman community, especially the families” of the victims.

“Our hearts and prayers go out to you in this devastating time. We too, as a family, are devastated by the events that transpired on Sept. 13 at Freeman High School,” the statement said. “The family asks the entire community to join them in praying for – and to continue to pray for – all of the children and their families that were involved in this incident.”

ABC News' Sabina Ghebremedhin contributed to this report.