That Alabama’s voters chose Doug Jones for the United States Senate is cause for celebration. A triumph for decency and common sense in a state that seemed for a time at risk of abandoning both, Mr. Jones’s win narrows the Republicans’ Senate majority and delivers a deeply deserved rebuke to President Trump. It is hard to get too intoxicated by a slim victory over an atrocious candidate, a suspected sexual abuser with bigoted politics, but Alabama, the Senate and the nation will be a whole lot better off with Mr. Jones than with Roy Moore.

Alabama’s deep-red politics argued against Mr. Jones’s chances. A former federal prosecutor, Mr. Jones won convictions of two Ku Klux Klan members for the 1963 bombing of Birmingham’s 16th Street Baptist Church that killed four girls, and no Democrat had won a Senate race in two decades. But a report in The Washington Post in which four women accused Mr. Moore of sexually harassing or abusing them as teenagers turned the race into a close contest. Mr. Jones’s victory came thanks to overwhelming support from Alabama’s African-American voters.

Mr. Jones received support from various luminaries, including Barack Obama, as well as an unexpected assist from Alabama’s senior senator, Richard Shelby, a Republican. “I couldn’t vote for Roy Moore,” Mr. Shelby said. “The state of Alabama deserves better.” Maybe it shouldn’t count as statesmanship to oppose a cartoonishly unfit candidate, but during the degrading and hyperpolitical Trump presidency, it does.