CUMMING, Ga. — A man wielding an assault rifle, explosives and supplies to take hostages opened fire outside a Georgia courthouse Friday, wounding a deputy before he was killed in a shootout with officers, authorities said.

Dennis Marx had been due in court Friday morning to plead guilty in a drug case. He arrived at the courthouse wearing body armor in a rented SUV with both homemade and commercially made explosives, two handguns, zip ties, water and other gear. He dropped homemade spike strips and used smoke devices in an effort to keep officers from reaching him, said Forsyth County Sheriff Duane Piper.

Authorities were familiar with Marx, who had placed obstacles around his home about 40 miles northeast of Atlanta when officers came to arrest him in the past. Bomb squads carefully checked the home in a hilly, wooded neighborhood, fearing he may have set explosive traps around the property. While explosive devices were found inside the home, they were not set to detonate, Piper said. Marx had left his house several days before the attack, Piper said.

The wounded deputy prevented others from getting hurt when he encountered Marx, Piper said. The sheriff’s office said in a news release that Marx tried to run over the deputy, and the deputy then shot at Marx.

Other deputies heard the gunshots and rushed to help, leading to a gun battle that lasted about two minutes and involved eight deputies, Piper said.