Many Americans seem astounded that conservative white Christians have remained steadfast in their support of President Trump, despite what they see as his immorality and deviation from professed Christian values. But history shows that this is far from the first time the faithful set aside their stated virtues to support a politician who violated them.

White evangelicals’ pragmatic and self-serving approach to political power has been consistent for at least a century, dating to fundamentalists’ adoration for Warren G. Harding in the 1920s — which sounded a lot like their championing of Trump today.

Although evangelicals preach family values and often claim moral superiority, history reveals that they are most interested in exercising political power and identifying politicians who help them do it. Evangelical leaders are sophisticated and pragmatic: Policy outcomes are what they really care about.

And when they find politicians who support their policies, they are willing to ignore personal moral failings. When their political allies act hypocritically or experience moral failings, evangelicals simply pray for their repentance and regeneration. They do not turn on their allies. Let he who is without sin cast the first stone, they say.

The fundamentalist movement emerged during World War I. Convinced that the death and destruction of the war indicated that Armageddon was near, Christians from many denominations organized a new movement to herald the end of time and the necessity of salvation. With what they considered to be God’s judgment coming upon all nations, they redoubled their political activism. They needed policies and policymakers who would heed their influence and support their favored policies, because nothing less than salvation was at stake.

To the leaders of the fundamentalist movement, then, the issues at stake in the 1920 presidential campaign were clear. They backed Harding, a Republican. Supporting Harding symbolized their frustration with the administration of Democrat (and devout Christian) Woodrow Wilson. They were especially leery of Wilson’s refusal to support congressional efforts to restrict immigration and his efforts to build the League of Nations.

Fundamentalists believed that non-Protestant immigrants undermined the “Christian” culture and that international organizations like the league threatened U.S. sovereignty. They advocated for “America first.”

For example, Arkansas minister Ben Bogard claimed that the league was foretold in biblical prophecy. It was going to serve as a vehicle through which the United States would cede power to a global tyrant, the long-awaited Antichrist. The minister hoped to persuade his fellow Southern white Democrats to support the GOP, at least in the national election.

“If you favor the League of Nations,” he preached, you should vote Democratic. “If you oppose the league,” and he thought they should, “you should vote for Harding.”

Once in office, Harding remained popular among fundamentalists. They appreciated his repeated invocations of God and the “old-time religion.” As journalists, academics and intellectuals increasingly scoffed at fundamentalists, they believed that the president had their interests at heart and that he was willing to stand with them against secularizing forces.

The need to curb immigration remained at the forefront of fundamentalist thinking and helped bind religious voters to Harding. Baseball-player-turned-preacher Billy Sunday was perhaps the most famous minister of the era. “They call us the ‘melting pot,’” he harangued. “Then it’s up to us to skim off the slag that won’t melt into Americanism and throw it into hell or somewhere else.”

Praise for Harding from fundamentalists went beyond immigration, however — and often overlooked his flaws. The editors of the leading fundamentalist periodical Moody Monthly routinely praised Harding for his leadership. “We are thankful just now for a Federal administration,” they acknowledged, “which seems honestly disposed to do its best for the nation.” They insisted that “it is generally admitted that the President has gathered around him an efficient cabinet with a genius for team work.”

But in reality, while Harding recruited some excellent people, he also appointed a number of his old Ohio cronies to prominent positions. While they kept his poker table competitive, his backrooms full of cigar smoke and his shelves well-stocked with bootleg whiskey, their presence in the administration was disastrous — at least for the American people.

Harding’s cronies sought to fatten their wallets with taxpayers’ cash. They made the administration one of the most corrupt in American history.

The administration’s most famous debacle — one of many — was the Teapot Dome scandal. Interior Secretary Albert Fall leased oil-rich federal lands in Wyoming to private companies in exchange for large bribes. He was the first Cabinet officer in U.S. history to be imprisoned for a crime committed while in office.

Nor did Harding’s private life measure up to fundamentalist standards. He had many extramarital affairs, with regular trysts taking place in the White House.

Yet, although his administration failed to embody Christian virtues, fundamentalists were distraught when Harding died in 1923. Seattle fundamentalist Mark Matthews preached a moving sermon about the “Christian statesman, the Christian gentleman, the Christian husband, and the Christian brother.”

Popular Los Angeles evangelist Aimee Semple McPherson preached a funeral oration on “Harding, the Christian President.”

Fundamentalist businessman and oil magnate Lyman Stewart praised the president as “an earnest Christian man” who “in all his speeches … advocated a return to the Bible and to Bible righteousness.”

None of which squared with Harding the carouser who presided over a corrupt administration. But this reality simply didn’t matter; he was an ally of Christian fundamentalists on the issues about which they cared, which meant overlooking his flaws.

Since the 1920s, fundamentalists and evangelicals have been consistently willing to excuse the moral shortcomings of politicians whose policy goals align with their own. In the 1950s, they ignored Dwight D. Eisenhower’s lack of religiosity and instead worked to get him baptized after he took office.

In 1980, the vast majority supported for president divorced actor Ronald Reagan, who rarely attended church, over the Sunday-school-teaching, born-again Southern Baptist Jimmy Carter.

And over the past four years, they enthusiastically embraced Trump.

Harding and Trump have much in common. They are among the most allegedly corrupt presidents in U.S. history. Their Cabinet teams have been racked by scandal. Like Harding, Trump’s personal morals are the antithesis of what religious Christians profess to demand.

But, like Harding, Trump maintains the support of the faithful because of his policies and the attention he lavishes on Christian voters and their faith leaders. Both presidents sought religion-based immigration bans. They criticize international organizations, avoid broad alliances and insist on America first, last and only.

And they use the Bible to justify their policy proposals. Trump, like Harding, praises the devout, advocates policies consistent with evangelical readings of the Bible and seeks to use his office to advance evangelicals’ theological agenda.

Trump’s embrace of their agenda is incredibly important for evangelicals, because today their values feel even more under siege on issues such as abortion, LGBTQ rights or the ability of Christian businesses to operate in accordance with their morals than they did in the 1920s, or even the 1980s. Thanks to a sense that they are losing the culture wars, evangelicals’ feeling of persecution has only grown, even as they have gained increasing amounts of political power over the past four decades.

Trump, even more than Harding, addresses this sense of persecution by making evangelicals feel powerful, defending their priorities and supporting their agenda.

In return, evangelicals ignore, downplay or embrace the president’s immorality, self-dealing and falsehoods as serving their agenda — just as they did with Harding.

Fundamentalists in the 1920s separated Harding’s personal morality from his pro-fundamentalist policies. Evangelicals in the Trump era do the same. If politicians champion white evangelicals’ proposals on immigration, foreign policy and religion in the public square, they are willing to forgive many, many personal sins. And when Trump’s nonvirtuous behavior serves their political goals by boosting his political power — for example, by accepting election interference from the Russians or by allegedly trying to pressure the Ukrainian president by withholding aid — they may see these acts as advancing a virtuous cause.

Sometimes they are honest about this trade-off, but most of the time they are not.

If history is our guide, someday, perhaps, we’ll even hear some of them delivering sermons reflecting on “Trump, the Christian president.”