Atlanta (CNN) -- A man armed with explosives and an assault rifle might have entered a north Georgia courthouse Friday if not for a deputy who was wounded in the shootout with the gunman, Forsyth County Sheriff Duane Piper said.
Authorities killed Dennis Marx outside the courthouse, Piper said during a news conference, adding that the gunman planned to wreak more havoc once inside the building.
"Mr. Marx's intention was to get in that front door and take hostages," he said.
The suspect began a "frontal assault" on the building by driving up, throwing out "homemade spike strips" to delay any police response, and trying to run over a deputy, Piper said.
Marx then began firing through his windshield, hitting the deputy in the leg, the sheriff said. He also threw gas grenades -- perhaps pepper grenades -- during the attack and had flex ties and water in his possession, according to the sheriff.
Deputies, some from inside the courthouse, engaged in a roughly 90-second shootout with Marx, killing him, Piper said.
The wounded deputy, who has not been identified, was shot while stopping Marx before he could get inside. The deputy is fine, the sheriff said.
The situation "was solved (with) that deputy's actions," Piper said.
Marx was scheduled to attend a hearing at the Forsyth County Courthouse on Friday, but the motive for the attack is still unclear, Piper said, declining to divulge what the hearing concerned.
"He came prepared to stay a while," the sheriff said. "(Marx) came here for the purpose of occupying the courthouse, it appears."
Forsyth County Sheriff's Office spokeswoman Robin Regan told CNN earlier that the office responded to a "shots fired" call Friday morning and said the scene "is now secure."
A witness, Alan Neal, said he was at an intersection in front of the courthouse in Cumming when he heard gunfire.
After he heard "two or three pops," he saw deputies fire on someone in front of the courthouse, Neal said.
Neal said he saw people tending to someone who appeared to be injured and police dragging someone else on the side of the courthouse.
Cumming is about 35 miles northeast of downtown Atlanta.