Sources said the incident happened in an industrial building where inmates have access to tools and pipes. Authorities said there can be up to 20 inmates in the welding shop and carpentry building at a time, as typically one officer makes the rounds.

"We believe for the first time in history, we've lost an officer to violence at our institution at Stillwater," Minnesota Department of Corrections Commissioner Tom Roy said.

Gomm was a 16-year veteran of the department. The union representing Gomm—AFSCME Local 600, Corrections Policy Committee and Council 5—issued a statement, saying,

We are grieving the tragic loss of Brother Joseph Gomm. Our hearts are heavy for his family, friends, and co-workers.

We offer our deepest sympathy and unconditional support for his family. We also offer our deepest sympathy to all who were touched by this wonderful man.

We ask that everyone cherish their lives every day.

Counselors will be on hand for prison workers Thursday to help them with the loss.

Roy said the Stillwater prison had 1,616 prisoners, about one-third of them serving homicide sentences.

According to the Minnesota DOC, attacks on corrections officers are rare. In fiscal year 2016, one assault was reported and in fiscal year 2015, 2 assaults were reported. There was one homicide in fiscal year 2014, according to the department.

JUST IN: The brother of Ofc. Joseph Gomm tells me "Joe had one of the kindest souls, heart, and was dedicated to his job, life, and family...” Today he and his work family are in mourning. More coverage on @kstp. pic.twitter.com/zlvwfXYKz1