UPDATED — June 6, 9:05 p.m. ET:
Authorities say Dennis Marx was armed with guns, explosives, and other supplies when he arrived at the Forsyth County Courthouse Friday morning.
Marx drove up to the courthouse and threw out smoke devices and homemade spike strips to prevent officers from reaching him.
He also tried to run over a deputy. The deputy shot at Marx, who returned fire, which went through the deputy's windshield and hit him in the leg, the sheriff said later Friday afternoon.
The wounded deputy, James Daniel Rush, underwent surgery for fractures in the lower leg, and said his condition is non-life threatening.
"When the deputy engaged him outside, it saved lives," Piper said of the 30-year veteran. "The entire situation was solved by that deputy's actions."
Other officers heard the gunfire and ran over to help. They engaged in a 90-second shootout outside the courthouse, which killed Marx.
"Mr. Marx is dead with multiple gunshot wounds," the sheriff said.
Both homemade and commercially made explosives were found in the car, suggesting Marx had planned the assault for days.
"Mr. Marx's intention was to get in that front door and take hostages," Forsyth County Sheriff Duane Piper said.
A witness's video shows officers closing in on a silver Nissan and then dozens of shots are fired before officers surround the vehicle.
Marx was expected at the Forsyth County Courthouse on Friday for a hearing, where he was to enter a plea for an August 2011 arrest.
He was charged with selling marijuana, firearm possession, and other counts.
Officials do not know why Marx was planning to attack the building, but he reportedly was obsessed with Columbine. Marx was also a former Transportation Security Administration agent, a U.S. official said.
Marx began working at TSA on Oct. 20, 2002, according to the official, until either 2003 or 2004.
Marx's home in Cumming, northeast of downtown Atlanta, was feared to be booby trapped with explosives.
Piper said that authorities searched Marx's home on Friday afternoon and explosives were found at the house, but it was not booby trapped. Officers believe he might not have been inside his home for as many as 10 days and had instead been staying in a hotel.
Michelle Broder Van Dyke is a reporter and night editor for BuzzFeed News and is based in Hawaii.
Contact Michelle Broder Van Dyke at email@example.com.
Got a confidential tip? Submit it here.