A prisoner trying to escape from a Michigan court wrested a gun from an officer, killing two bailiffs and injuring two more people before he was shot dead.
People scrambled for cover inside Berrien County Courthouse in St Joseph, about 100 miles north east of Chicago.
"Our hearts are torn apart. I have known them for over 30 years. It's a sad day," Sheriff Paul Bailey said of the bailiffs, Joseph Zangaro, 61, and Ronald Kienzle, 63.
Zangaro, who was head of court security, had retired from Michigan State Police as commander of the Bridgman Post in Berrien County.
Kienzle retired as a sergeant with Benton Township police after serving in the US army. Both had been employed by the court for more than a decade.
Larry Gordon, 44, who was in custody facing several felony charges, was being moved from a cell for a court appearance on Monday when a fight broke out and he was able to disarm an officer, Bailey said.
He shot sheriff's deputy James Atterberry, killed the bailiffs, then shot a woman civilian in the arm in a public area, the sheriff said. Atterberry, 41, is in a stable condition at Lakeland Hospital following surgery on his arm.
Gordon was finally shot dead "by two other bailiffs who came to render aid, along with several other officers", Bailey said. "He was trying to escape."
During the incident, Gordon took hostages for a short period before trying to leave through another door.
The sheriff said it did not appear that Gordon was handcuffed and authorities had "no warning signs" that he would be violent.
Gordon's ex-wife Jessica Gordon told WOOD-TV and the Detroit Free Press that he was probably trying to escape to see his family. She said he was "not a monster" but "an amazing man that got mixed up with the wrong people".
Ms Gordon said they divorced earlier this year but he remained close to his six-year-old daughter. She said she spoke to him on Sunday and had no indication he was planning an attack.