Carlo Allegri / Reuters

MONTGOMERY, Ala.—Everything had to break exactly right for Doug Jones to win the U.S. Senate election in deep-red Alabama, and it did. Jones ran a disciplined campaign that hinged on the turnout of black voters, and it delivered for him.

But everything also had to break the wrong way for the Republicans, and it did: A series of machinations among senior GOP officials led to a runoff between the unpopular Luther Strange and Roy Moore, best known for losing his judgeship over a dramatic battle to keep a 10 Commandments monument in the state’s supreme court. Moore had a loyal base of support in Alabama despite—or because of—the litany of controversies attached to him, including his inflammatory remarks about homosexuality and Muslims serving in office. He was unable to reach beyond that base, however, and barely tried. In the end, Moore could not survive allegations by nine women that he had pursued or sexually abused them when they were teenagers—one as young as 14. The story consumed the final weeks of the campaign, with Moore unable to offer a substantive rebuttal, instead attempting to discredit the mainstream media and his accusers. He went underground during the race’s final stretch, hardly appearing in public, while Jones barnstormed the state.

Fighting the last battle is a common political mistake. Moore’s campaign and his biggest backers, such as the Breitbart News chairman Steve Bannon, thought that Moore could survive the allegations by doubling down and toughing it out, the same way President Trump defied conventional wisdom and won despite the Access Hollywood tape. They were wrong. Moore’s loss showed that some laws of gravity still apply in politics.

“Roy Moore’s problems were much bigger than just the allegations of impropriety,” says Lance Hyche, an Alabama Republican consultant. “Many pro-business Republicans have long held a bad taste for Moore’s agenda. Plus, he ran a terrible campaign.”

Though Bannon publicly projected confidence about Moore, by Election Day he was less than certain Moore would win. “I don’t know,” he said when asked what he thought would happen on Tuesday. “I don’t want to get overcocky.”

Moore held his election-night party at the RSA Activity Center, in downtown Montgomery, the same venue where he held his event on the night of the runoff. This time, though, members of the press were penned off in the back by barricades, not allowed to roam freely. Reporters were given press credentials featuring only close-up photos of Moore’s face on the front and back. Journalists from The Washington Post, which broke the story of Moore’s alleged misconduct, were denied credentials.

As results slowly trickled in from around Alabama, The New York Times’s election results were projected on a big screen behind the stage. At first, as more red appeared on the map, the mood was jubilant; a saxophonist covered pop songs such as “Happy” by Pharrell and “Smooth” by Santana ft. Rob Thomas. But as the night wore on and it became clear that Jones was outperforming expectations, the room fell silent. Supporters sang hymns including “How Great Thou Art” and “Great Is Thy Faithfulness.”

Even after the Associated Press and Fox News called the race for Jones, Moore refused to concede. His campaign chairman, Bill Armistead, came onstage to announce that the campaign was waiting for more votes to come in and preparing for the possibility of a recount. Moore encouraged everyone to go home and sleep on it, an echo of the Clinton campaign chairman John Podesta’s late-night announcement on election night last year.

But at least from Donald Trump’s perspective, it was time to put a fork in it. The president tweeted his congratulations to Jones shortly after the race was called and didn’t mention Moore, for whom he had campaigned on Friday at a rally in Pensacola, Florida, near the Alabama border.

Andy Surabian, Bannon’s political adviser, also acknowledged the loss.

“Mitch McConnell and his establishment allies got the Democrat that they wanted in Alabama, and are now threatening and openly defying President Trump's agenda,” Surabian said. “Make no mistake about it, Mitch McConnell is now the highest ranking Democrat in America. Congratulations, Swamp.”

Bannon himself had taken the same line earlier that day. “We have very limited downside” in the event of a Moore loss, he told me on Tuesday, even before results came in. “If Moore loses, the firestorm against McConnell will reach a fever pitch, people will be off the chain. They will come for McConnell like you’ve never seen before and Shelby will be finished down there.”

“If we lose, it’s actually worse for McConnell.”

McConnell’s allies, for their part, were equally quick to pin the loss on Bannon, who had championed Moore as part of his war against the Senate majority leader. Steven Law, the CEO of the McConnnell-linked super PAC Senate Leadership Fund, sent out a statement blasting him: “This is a brutal reminder that candidate quality matters regardless of where you are running. Not only did Steve Bannon cost us a critical Senate seat in one of the most Republican states in the country, but he also dragged the president of the United States into his fiasco.”

Bannon had lobbied for Trump to back Moore, though Trump didn’t seem to need much persuading after mustering little enthusiasm for Moore’s opponent, Strange, during the primary. Still, Trump had predicted while campaigning for Strange that Moore would have a tough time winning the general election—and he was right.

“Moore losing in the end is a blessing. He is one dumb, weird guy,” says one source close to Trump, who spoke on condition of anonymity in order to speak candidly about private conversations. “Mo was the guy who should have ran,” the source says, referring to Mo Brooks, the congressman forced out after the initial round of voting.

* * *

A special Senate election in Alabama would normally be a snoozy affair, as far as the wider political world is concerned. But Tuesday’s voting capped a wild few months that gripped the country, as Alabama became the focus of America’s political and cultural conflicts. The race played out amid the torrent of sexual-misconduct allegations against powerful men that have been rocking American culture, and it highlighted both the deepening divide in the Republican Party and the Democratic Party’s efforts to rebuild after last year’s presidential-election loss.

One factor Moore and his backers didn’t fully take into account was the viability of Jones, a prosecutor who made his name bringing Ku Klux Klan members who bombed a black church in Birmingham in 1963 to justice. After the allegations against Moore came to light, various polls showed Jones within striking distance of Moore, or even in the lead. Jones’s strategy was to beat the odds in Alabama’s heavily Republican electorate by turning out as many black voters as he possibly could and by picking off more-moderate Republican voters who couldn’t stomach voting for Moore, even if the party establishment decided to tolerate him.

To accomplish this, Jones campaigned heavily in black neighborhoods and churches and brought in high-profile black Democrats such as Deval Patrick and Cory Booker to help him. He chose symbolically important places, scheduling a Saturday press availability outside the Brown Chapel AME Church in Selma, the starting point of the historic civil-rights marches to Montgomery led by Martin Luther King Jr.

To woo Republican voters, Jones’s campaign and outside groups took advantage of prominent Republicans’ resistance to Moore, cutting ads based on Alabama Senator Richard Shelby’s refusal to vote for him. Shelby’s decision to go on television and oppose Moore on the Sunday before the election was a significant statement. “That’s about as out on a limb as you see him get,” David Mowery, an Alabama political consultant who ran Bob Vance’s campaign against Moore, in 2012, told me. “He’s the cagiest pol in our state, so he knows what he’s doing there.”

Jones also enjoyed a large spending advantage and, as is the case with many Democratic politicians, celebrity backing. The Alabama-rooted musical acts St. Paul and the Broken Bones and Jason Isbell held free get-out-the-vote concerts for Jones, and on the night before the election, the former NBA star Charles Barkley, an Alabama native, campaigned as well. “At some point we’ve got to stop looking like idiots to the nation,” he told voters. This message—vote for Jones to save face for Alabama in the country’s eyes—was a key element of the pitch made by Jones’s surrogates. “Don’t let anybody talk down to Alabama,” Booker told Jones supporters at a Birmingham field office on Sunday.

* * *

While Barkley was stumping for Jones in Birmingham on Monday night, a motley crew of right-wing characters was doing the same for Moore in Jordan’s Activity Barn in Midland City, in the southeastern part of the state. The rally was themed “Drain the Swamp,” and a faux swamp—a tarp with toy alligators on it—had been set up outside. The back half of the barn was fenced off for the press, while the front half was crowded with Moore’s supporters. In a VIP area up in an upstairs loft, Bannon, Sheriff David Clarke, and others could be seen mingling by those down below. Also in attendance were Paul Ryan’s nationalist challenger Paul Nehlen, who recently appeared on the alt-right podcast Fash the Nation, and Corey Stewart, the former Trump Virginia state chair who nearly beat Ed Gillespie in that state’s gubernatorial primary this year.

A series of speakers took aim at the mainstream media and Moore’s accusers—both of which Moore and his allies had been busily trying to discredit. The affair facilitated the release of pent-up rage at the forces Moore and his allies saw as trying to destroy him.

Texas Representative Louie Gohmert, a stalwart of the House Freedom Caucus, spent most of his speech attacking Moore’s accusers. He referenced the Biblical character Jezebel and implied that some of the accusers had been paid: “If somebody got money for trying to destroy a righteous man, there’s a place called prison.”

And Bannon, who has spent the autumn giving speeches around the country promoting his 2018 plans, told the crowd that it shouldn’t let outsiders tell Alabamians how to vote. (Bannon grew up in Virginia, and has lived in California, New York, and Washington, D.C.) This was Bannon’s third appearance on Moore’s behalf in Alabama; he spoke at a rally in Fairhope before the runoff, and at another in Fairhope last week. Only this time, he and his former boss were on the same side. (Jones reacted to Bannon’s speech last week by tweeting that he is an “outside agitator” who was “carpetbagging” in Alabama—both loaded terms hearkening back to Alabama’s pained racial history. Bannon castigated MSNBC’s Joe Scarborough for having called him a “Yankee,” saying that he is from the “capital of the Confederacy” and boasting that Scarborough didn’t “make the cut” at the elite schools Bannon got into, Georgetown and Harvard.)

Moore’s wife, Kayla, spoke before Moore did. She said that Moore, who recently suggested that the Jewish billionaire George Soros is going to hell, is not anti-Semitic because the couple has Jewish friends and because “one of our attorneys is Jewish.”

And Moore, who had not held a public campaign event for nearly a week—he confirmed onstage that he had been out of state over the weekend, visiting his son at West Point—was similarly aggrieved.

The allegations against him are “disgusting,” Moore said. He was surrounded by “alligators,” he said. “We’re up to our neck in people that don’t want change in Washington, D.C.; they want to keep their power, keep it the same, keep their positions, and we’ve got to change that.”

Bannon was by then camped out in a room upstairs designed for brides getting ready for their weddings—the room next door had “Groom” on the door. (The barn is a frequent wedding venue.) Bannon was hosting his SiriusXM radio show from the site. Members of his entourage of advisers, Breitbart employees, and security guards shuffled in and out, speaking in hushed tones and watching the Patriots–Dolphins game on TV. Bags of snacks were piled up in a corner. Clarke, having taken off his signature hat, came in to do the radio show.

When Moore finished speaking, he and Kayla came in so that Moore could join the show. Then Gohmert came in, dragging a carry-on suitcase, and a series of photos were taken of Moore, Gohmert, and Clarke in various combinations.

Bannon interviewed Moore for several minutes, focusing on Shelby’s opposition to him and casting the race as an “up or down vote on the Trump agenda.” (“It doesn’t help,” Bannon told me that night about Shelby’s opposition. “It's unacceptable that a sitting United States senator would basically not back the Trump agenda by trying to toss the race to a Democrat, particularly a progressive Democrat like Jones.”

Moore stuck to the theme of his race being a referendum on Trump’s agenda, saying that Shelby “doesn’t want a voice in the Senate that would stand up for Trump.”

“You’ve been a great help, Steve, and we appreciate you and standing for what this country’s about,” Moore told Bannon.

As Moore turned to leave, Gohmert buttonholed him, speaking excitedly into his ear. Then the Moores stepped out into the lofted area and made their way downstairs, where reporters caught sight of them and shouted questions. They hustled into a waiting car. The Breitbart crew stayed behind. Their show was still going on.

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.