NINE YEARS ago, the Senate confronted the immensely polarizing issue of gun control. At the time, a Republican and a Democrat offered an amendment to close the loophole that allowed people to buy guns from unlicensed sellers at gun shows without background checks. Fifty-three senators, including eight Republicans, voted for the amendment. One of the sponsors was Sen. John McCain (R-Ariz.), who lamented, “Criminals and terrorists are exploiting this obvious loophole in our gun safety laws.”

The amendment passed but the legislation died. Now a similar effort is unfolding on the Senate floor in the compromise, worked out by Sens. Joe Manchin III (D-W.Va.) and Patrick J. Toomey (R-Pa.), that would expand federal background checks of prospective gun purchasers to include all commercial sales, including at gun shows and online. Voters say in public opinion polls that they strongly favor expanded background checks, yet the deal faces implacable opposition from the National Rifle Association.

The compromise may hinge on the votes of a few Democrats, up for reelection next year, who fear a backlash from the potent gun lobby and a few Republicans who seem to want to support the measure yet fear the political fallout. A handful of senators in either party could swing the outcome.

Into a swirl of overheated and exaggerated rhetoric, a voice of sanity was heard Sunday — the author of the amendment in 2004. “Eighty percent of the American people want to see a better background check procedure,” Mr. McCain said on CNN. “I’m very favorably disposed” toward the Manchin-Toomey compromise. “And the American people want to do what we can to avoid these tragedies.”

Since Adam Lanza opened fire on Sandy Hook Elementary School first-graders and staff, killing 26, as well as his mother and himself, a real question has been how to channel the outrage into support for legislation that would improve gun safety laws and, perhaps, head off a future killing spree. At first, there were calls for restoring the ban on semiautomatic assault rifles like the one Mr. Lanza used to fire 154 bullets in five minutes. That now appears politically impossible. Then there was the question of banning the high-capacity ammunition magazines used at Sandy Hook and in other mass murders. That, too, is in doubt. The background-check measure, closing loopholes that have long been known and abused, has enjoyed the most public support and seemed to be relatively certain to pass — and now, it too, hangs in the balance.

It is time to stop retreating. The compromise isn’t ideal, but it represents the best of bipartisan efforts for the common good. As Mr. McCain noted on the weekend, “We need to do a little more of that.”