WXIA-TV, Atlanta

CUMMING, Ga. — Authorities killed a man Friday whom they say shot a sheriff's deputy in the leg outside the Forsyth County Courthouse.

The man, gun trader Dennis Ronald Marx, 48, drove up on the sidewalk in front of the courthouse at about 10 a.m. ET, threw spike strips and explosives out his car window to keep officers from reaching him then began shooting through the windshield of his SUV with an assault rifle, Forsyth County Sheriff Duane Piper said. Deputies returned fire, shooting Marx multiple times.

It was unclear whether the deputy who first encountered Marx killed the suspect.

"When the deputy engaged him outside, it saved lives," Piper said. "The entire situation was solved by that deputy's actions."

Authorities later identified the officer as James Rush, 46, of Cumming. He's been a Forsyth County deputy since February 1990 and is expected to make a full recovery.

Officials say Marx had planned the attack for a long time. He was carrying grenades, homemade explosive devices, water, zip ties and several magazines of ammunition and had rigged his body with explosives.

Court records show that Marx filed a federal civil rights lawsuit against the sheriff's department in 2013.

In August 2011, Marx was arrested on charges of possession of marijuana with intent to distribute and firearm possession during a felony, among other counts, said his lawyer, Ann Shafer.

That same month, authorities filed court papers seeking to seize two dozen handguns and rifles, 71 gun magazines and $24,311 in cash from Marx. The lawyer who represented Marx in the civil seizure case, Richard Grossman, said officers found the weapons cache after an undercover officer bought drugs from Marx.

Marx was scheduled to appear in court Friday morning to enter a guilty plea in the drug case but did not show up.

Shafer said she waited for her client, whom she described as slightly unstable at times, for about 40 minutes then left the courthouse about 40 miles northeast of Atlanta. As she walked out, she heard gunshots and wondered whether Marx was responsible.

"I find people remarkable in their reactions to the legal business," Shafer said. "I feel very lucky that I walked out the back of the courthouse instead of the front."

Marx had made veiled threats against her and his other lawyers in the past, she said.

"We lawyers take our chances in representing people who are not always the most stable on the face of the earth," Shafer said.

In Marx's federal complaint against the Forsyth County Sheriff's Department, he accused deputies of using excessive force and making illegal searches. He claimed that officers hit him when he was standing with his hands up, used chemical agents to make him believe an explosion or fire had occurred and used an extra set of handcuffs that cut off circulation to his hands.

A lawyer representing the sheriff's department in the case was not immediately available. Piper said Marx had been arrested multiple times in the past, and on one occasion had set traps outside his home in Cumming, which has about 5,500 residents.

About two hours after the attack, the area around the Forsyth County Courthouse was secured, Piper said.

Officers are searching Marx's home and are worried that it might be booby trapped. He apparently had not been living at his house for the past 10 days.

Contributing: The Associated Press