The letter by Larry Darnell Gordon was found after authorities searched a Berrien County Jail unit where he had been housed before a July 11 appearance at the county courthouse in St. Joseph, sheriff's Detective Lt. Greg Sanders said Friday during a news conference.
"I'm not trying to die, and I don't want too," the letter reads. "I'm just trying to get free and I'll die trying.
"Getting free is the only chance at being able to see you!!! Hopefully I make it!!!"
Gordon, 44, was facing possible life in prison on rape and kidnapping charges involving a 17-year-old girl.
Moments after a handcuffed Gordon had been removed from courtroom 315, a security camera recorded sounds of a struggle from an adjacent holding area.
Police have said Gordon attacked and disarmed Deputy James Atterberry Jr. and wounded him.
Bailiffs Ronald Kienzle, 63, and Joseph Zangaro, 61, rushed to the area and were shot and killed.
"He's got a gun" and "help me" are heard from the holding area. Someone also is heard yelling at Gordon to put the gun down, Sanders said.
About a dozen people were inside the courtroom. Some initially fled through a door, while others ducked beneath benches before court staff ordered them to leave.
A man identified by Sanders as Gordon yells "I got hostages."
Sanders said Gordon had eight hostages. Cameras outside the courtroom show some hostages fleeing down a hallway as other bailiffs converge on Gordon.
Gordon can be seen crossing a hallway while using a female hostage as a human shield. They are followed by three other hostages.
What follows are about a dozen gunshots, Sanders said.
A bailiff said he "took the shot to save the hostage's life," Sanders told reporters. "Another bailiff began firing and they continued to fire until he was no longer a threat."
A female hostage was shot in the arm by Gordon, Sanders said.
Gordon was arrested in April and accused of holding the teenage girl against her will for two weeks and giving her methamphetamines in exchange for sex.
Police had gone to his Coloma Township home to serve Gordon with a domestic violence warrant, prosecutors said earlier this month. Gordon barricaded himself in a shed and escaped through a back access door before being found several streets away. Officers later found the girl in the shed.
In the letter to his ex-wife, Gordon wrote how much he will miss her and their daughter.
"Baby they want to send me away for the rest of my life," Gordon continued. "I don't deserve that. That's not living. I'm not going to do it!!!" null