CUMMING, Ga. — A man was shot to death on Friday by law enforcement officials after he brought an arsenal, including an assault rifle and a large supply of ammunition, to the county courthouse here and tried to mount what the authorities described as a “frontal assault” on the building.

Sheriff Duane K. Piper of Forsyth County said that the man, Dennis R. Marx, who had described himself in a court document as a “Glock armorer” who took part in gun shows across the South, was killed Friday during a three-minute firefight with sheriff’s deputies that briefly transformed part of this quiet Georgia city into a battleground. Mr. Marx had been scheduled to appear in court for a hearing about a pending case involving drug and weapons charges.

“It was very close to being a major catastrophe,” Sheriff Piper said at a Friday afternoon news conference after reviewing surveillance tapes of the confrontation, which he said would eventually be made public.

Sheriff Piper described a chilling plot that the authorities believed had been in the works for days.