A week after a bombshell Washington Post report detailed allegations of his romantic pursuit of teenage girls, the fate of Alabama Senate candidate Roy Moore looked grim. Everyone from Senate majority leader Mitch McConnell to Ivanka Trump spoke out against Moore’s continued candidacy, with the latter saying in a statement that there was “a special place in hell for people who prey on children.” Even unwavering Trump ally Sean Hannity expressed his doubts. That moment of moral clarity didn’t last long: Donald Trump rebuked his own daughter by forcefully endorsing Moore. The Republican National Committee, which had stopped fund-raising for Moore, turned the money spigot back on. Meanwhile, the relentless conservative media campaign to cast doubt on Moore’s accusers seems to have worked: After an initial drop in the polls, Moore now looks to be running about neck-in-neck with Democrat Doug Jones, with fewer than 1 in 6 Republican-leaning voters saying they believe the allegations are true.

The dramatic reversal recalls the aftermath of the October 2016 release of the Access Hollywood tape that many believed would torpedo Trump’s candidacy. And behind the scenes, the same man who encouraged Trump’s allies to stick by him has been working tirelessly to prop up Moore, whom he supported against establishment Republican candidate Luther Strange: erstwhile Trump adviser Steve Bannon. “He’s the counter to the ‘fake news’—he’s been a stalwart,” Moore told Bloomberg of Bannon. “It’s helped us a lot. He’s the master strategist.”

Though Bannon’s associates and allies recently told me, that they’re unhappy that their fortunes are yoked to Moore, Bannon’s public support has never wavered. Meanwhile, his private approach has reportedly been two-pronged: first, he worked to discredit the accusers and the press who reported on their claims; second, he launched an effort to win back conservative media figures. The first wasn’t exactly a stroke of strategic genius; right-wing pundits began to question the accusers’ accounts in almost the same beat as they were made public, and Trump, whose endorsement had the potential to make or break Moore among his powerful base, privately questioned them from the outset, reportedly complaining that the #metoo movement is spiraling out of control. But the second approach proved crucial in the aftermath of Hannity’s near-defection.

After Hannity issued an ultimatum on his show demanding Moore explain his actions “within 24 hours” or risk losing his support, Bannon reportedly went into overdrive: