SUSSEX COUNTY, Va. (WAVY) — A K-9 at Sussex I State Prison was killed while responding to a recent attack by MS-13 gang members at the prison.

The Virginia Department of Corrections says K-9 Rivan died after being “violently and repeatedly stabbed and kicked” by the inmates at one of the facility’s housing units on Tuesday, April 2.

They say three inmates involved in the assault are affiliated with the gang and were in the process of attacking another inmate. A fourth inmate appeared to be supervising the assault, VADOC said.

The Belgian Malinois would have turned 6 years old on April 30. He joined VADOC in 2019.

“The loss of Rivan is truly tragic, but it is important to remember he did not die in vain.” said VADOC Director Chad Dotson. “He lost his life while potentially saving the lives of two people, his assigned Officer and an inmate. The VADOC will never forget Rivan’s sacrifice.”

Rivan’s handler, Corrections Officer Kharmishia Phillip Fields, wasn’t seriously hurt “due to her training and Rivan’s courageous actions,” VADOC says. The attacked inmate meanwhile was taken to the hospital for his injuries and later returned to the prison.

“The safety of our corrections team is our agency’s top priority,” Dotson said. “Officer Phillip Fields has the agency’s full support during this difficult time and I personally wish her well in her recovery. The heroics she displayed during this brutal assault demonstrate her courage, her commitment to public safety, and her care for the safety of the inmate population. I thank her for her service to the Commonwealth.”

VADOC says the inmates involved in the attack are from El Salvador and Guatemala, and were in the U.S. illegally at the time of their arrest. The charges they were convicted of include first-degree murder and attempted rape.

“The Virginia Department of Corrections intends to pursue prosecution of these inmates to the fullest extent of the law,” the department said in a press release.

The case remains under investigation, and the department plans to hold a memorial service for Rivan coming up.