ON WEDNESDAY, investigators say, 28-year-old Floyd Lee Corkins II, armed with a 9mm pistol, boarded Metrorail in East Falls Church and headed for the District headquarters of the Family Research Council (FRC) on G Street NW. A devotee of the German philosopher Friedrich Nietzsche and volunteer at a support center for the gay community, Mr. Corkins apparently was on a mission to attack the organization famous for anti-gay rhetoric and “research.” Considering the 50 rounds of ammunition he allegedly carried in his backpack, it looks like that mission was to kill.

Thanks to the quick and clear-headed response of Leonardo R. Johnson, 46, the security guard on duty, Mr. Corkins was stopped in his tracks, and countless lives may have been saved.

According to an FBI affidavit, the young man approached him, pistol in hand, and said: “I don’t like your politics.” Immediately, Mr. Corkins shot Mr. Johnson in the arm. What happened next is a testament to Mr. Johnson’s valor in a moment of peril.

Ignoring his injury, he charged ahead, subdued Mr. Corkins and wrested his pistol away. Mr. Corkins faces a federal charge of assault with intent to kill, and it’s likely due to Mr. Johnson’s bravery that the charge didn’t become multiple counts of first-degree murder. As the guard said in a television interview from his hospital room: “Although I didn’t want to get shot, nobody wants to get shot, I feel that God put me in a position to be there at that time.”

In a city that’s no stranger to attacks that have put security guards in danger, sometimes fatally, Mr. Johnson’s conduct is exemplary. When he could have merely protected his own life, he chose to do what he could to save the lives of others. The District police chief was right to recognize him as a hero.

We are among those who find some of FRC’s views abhorrent — its position, for instance, that homosexuality is “harmful to the persons who engage in it and to society at large.” But any violence is unacceptable, and violence intended to stifle debate or punish those with opposing views is a fundamental threat to democracy. If the official account of Wednesday’s events is correct, Washington is lucky that no one died — and indebted to Mr. Johnson.

Thankfully, he is reported to be recovering well.