Edward Muhammad Johnson. Johnson is accused of using a weapon to attack Officer Joseph Gomm on at the Stillwater state prison. Minnesota Department of Corrections via AP

Edward Muhammad Johnson was formally charged Thursday with second-degree murder in connection with the death of Stillwater prison corrections officer Joseph Gomm. Johnson, 42, was also charged with second-degree assault with a dangerous weapon.

Washington County Attorney Pete Orput also said Thursday he intends to take the case to a grand jury, which is required for first-degree murder charges in Minnesota.

The criminal complaint contains new details on what happened in an industrial area of Stillwater prison on July 18. Gomm was found with injuries to his head and face by responders to a call of an attack on an officer. An autopsy found he had a blunt force injury to his head and puncture wounds to his chest.

A shop foreman, a corrections employee, saw Johnson hitting Gomm in the head with a hammer. After he yelled at Johnson to stop, the inmate moved toward the foreman and swung the hammer. The employee then barricaded himself in a stairwell.

A number of inmates said Johnson told them, "You guys are fine," according to the complaint. Inmates also saw Johnson running shirtless from the machine shop. Johnson was seen opening a back door, triggering an alarm, before he surrendered to corrections officers.

Investigators found that Johnson had a hammer checked out to him. The hammer and two homemade knives were found near Gomm. Investigators say one or both of the knives were used to stab Gomm.

Johnson was serving time for a 2002 murder when Gomm was killed. The Minnesota Bureau of Criminal Apprehension has been investigating the prison slaying.

Gomm was buried with full honors at a cemetery in Roseville last week.