But the magazine’s unsparing Thursday editorial, which said Trump has a “grossly immoral character” and should be removed out of “loyalty to the creator of the Ten Commandments,” clearly rattled the White House and the evangelical leaders who have tied themselves closely to the president.

Trump derided it as a “far left magazine . . . which has been doing poorly” in a tweet Friday morning, although the magazine is considered far from liberal. He later took to Twitter to tout his record on issues important to the Christian right.

“The fact is, no President has ever done what I have done for Evangelicals, or religion itself!” he wrote.

Beneath the president’s angry outbursts lies a fear that, ahead of the 2020 election, Trump could lose some evangelical supporters, who as a group have remained durably bonded to him despite his payments to an adult-film star after allegations of an affair; attacks on war heroes, congressional widows and a teenage climate activist; boasts of sexual assault caught on tape; and the regular use of profanity at rallies from behind the presidential lectern.

Even a slight drop in support among these voters could be detrimental to the president’s reelection hopes, particularly in swing states. An NPR-PBS NewsHour-Marist poll from earlier this month found 75 percent of white evangelicals approved of Trump, compared with 42 percent of Americans overall. Evangelicals surged to the polls in key battleground states in 2016 to vote for Trump — and campaign efforts are already underway to make sure they return en masse in 2020.

But Trump’s presidency has reflected a sharp divide among evangelicals across generational and racial lines, especially since many younger evangelicals and evangelicals of color are less likely to support the president on issues like immigration.

Among pastors, political strategists and even the author of the magazine piece, Mark Galli, there was little belief the editorial would be a seminal moment of revolt against the president.

Several White House officials, who spoke on the condition of anonymity to describe private deliberations, said they believed Trump was bringing too much attention to the editorial in a magazine that is largely read by elite pastors and, according to its publisher, has a paid circulation of 90,000. They said that in their view, he was probably overreacting to the criticism after a long week in which he became the third president in U.S. history to be impeached.

Trump officials were still under pressure to act. The Trump campaign emailed out a statement from Cissie Graham Lynch, Billy Graham’s granddaughter, praising the president. It later announced it is launching “Evangelicals for Trump” at an event in Miami on Jan. 3.

While the event was already in the works, it was announced Friday to appease the president, who also wants evangelical leaders to come to the White House in January, according to one White House official.

“He’s putting a lot of pressure on people because he thinks this is a big deal,” the official said.

Trump has often weathered incidents that could potentially hurt him with evangelical voters. After the Access Hollywood tape in which Trump bragged about assaulting women came out in late 2016, Paul Djupe, a political scientist at Denison University who studies religion and politics, did an online poll of about 1,000 Christians and found there was no movement in their attitudes toward Trump.

“I don’t have any illusions that because of what I wrote or because it was under the masthead of Christianity Today that it’s going to change many minds,” Galli said. “It’s not going to change many minds.”

Galli said he agreed with many of the president’s policy decisions — including the judges he nominated and his support for antiabortion policies — but could no longer balance what he viewed as substantive moral failures. He likened the president to a wife abuser who also has good qualities.

Several prominent white evangelical leaders rushed to the president’s defense, citing his record and their contention that Trump’s impeachment was a politically motivated hit job by Democrats. The Rev. Franklin Graham posted a long defense of Trump on his Facebook page, revealing that his father, Billy Graham, voted for Trump.

Several evangelical supporters of the president described him as an imperfect man who has nonetheless been good for their agenda.

“Nobody thinks Trump is Saint Donald,” said David Lane, an influential evangelical leader who organizes pastors. “For whatever reason, in my opinion, God raised Donald Trump. Everything he said he’s going to do, he’s done from an evangelical standpoint. None of the other candidates in 2016 would have done what Donald Trump has done.”

What has drawn white evangelicals to the president is a sense that he is always fighting for them and against an array of secular forces they detest, said Matt Moore, a former chairman of the South Carolina Republican Party with deep ties in the state. In South Carolina, Moore said, evangelicals support Trump even more than in 2016.

“A lot of evangelicals believe the current culture war is a zero sum game and their side has to win,” Moore said. “They see Trump as sort of a Moses figure who is leading them out of the wilderness.”

Trump asked on Twitter whether evangelicals would ever want former vice president Joe Biden, Sens. Bernie Sanders (I-Vt.) and Elizabeth Warren (D-Mass.), or those of the “socialist/communist bent” to be their president. He has regularly argued to voters that they have to support him, no matter his foibles, because his opponents would be much worse on the issues they care about.

James Dobson, who founded Christian organization Focus on the Family, took issue with how the editorial did not state who should replace Trump: Vice President Pence or a Democrat? He ticked off more than a dozen issues in which he believed Democrats would be worse than Trump, such as school choice, abortion, Israel, gay rights and “men in women’s sports and boys in girls’ locker rooms.”

Ralph Reed, a longtime activist who works to get evangelical political support, called the piece “over the line, unfortunate and ill-advised” because it questioned the faith of Christians who support Trump.

“There are plenty of compelling moral reasons based on policies that promote the common good to support Trump without supporting everything he’s ever done,” he said.

Christianity Today’s editorial is less likely to change hearts and minds as it is likely to help give voice to people who have been silent on Trump, said Doug Birdsall, who is honorary chair of Lausanne, an international movement of evangelicals that was started by Billy Graham. He said he sent the editorial to 500 influential leaders around the world on Friday. Billy Graham’s grandson Boz Tchividjian praised the piece, calling it “well said on so many levels.”

Birdsall, who organized a gathering in 2018 to discuss the Trump era, noted how some evangelical pastors and leaders have voiced their concerns in the past, including Max Lucado, Tim Keller, Peter Wehner and Washington Post columnist Mike Gerson.

“Those who have perhaps sat in silence not wanting to be divisive or political realize there’s a certain point where . . . the dangers outweigh the choice of remaining silent,” he said. “It’s morally powerful.”

While most pastors will be delivering sermons Sunday focused on Jesus ahead of Christmas, Birdsall said he thinks the editorial will generate conversation.

“There’s a sense that so-called evangelicals have a greater love for Trump than they do for Christ. Evangelicals have become synonymous with Trump. When you think of evangelicals, you don’t think about Jesus and the Bible, you think of red hats and Trump,” he said.

Trump is not known to regularly read the Bible or pray. He has mistaken the communion plate for a collection plate.

Pence, Rep. Mark Meadows (R-N.C.) and other Republicans have encouraged Trump not to use the Lord’s name in vain at rallies — a singular sin among Christians. The president swears frequently in White House meetings and regularly makes derogatory comments about people and their appearances, including this week suggesting that the late congressman John Dingell, the longest serving member in House history, could be in hell after his wife, Rep. Debbie Dingell (D-Mich.), voted to impeach the president.

Trump has installed Paula White, a televangelist who preaches the “prosperity gospel,” as one of his key religious advisers — concerning some in the evangelical community.

But the president often mentions his political support among Christians during White House functions. He makes a show of saying “Merry Christmas” and contends falsely that previous presidents did not.

Trump has spoken at religious events and likes to be photographed at the White House with pastors laying their hands on him in prayer. He called for Christians to pray for him this week amid impeachment.

At the magazine’s small headquarters in Illinois, where about 50 people put out the publication, there were some cancellations Friday. David Sutter, a pastor at York Bible Church in Pennsylvania, described himself as a subscriber “for years and years and years” but canceled after the editorial.

But Galli said he has received much support to go along with the attacks. His children were amazed that the president had attacked him on Twitter. He was on CNN nearly every hour Friday, wearing a sweater vest to calmly discuss his piece.

Galli, who is retiring at the end of the year, said he wanted to correct some of the claims in the president’s tweet. He said the magazine is not liberal and is not financially troubled, He also said it received a surge in donations and new subscribers, adding that he had not heard from the White House or anyone connected to Trump.

“It has touched a chord beyond what I ever believed,” he said. “We have a lot of evangelical readers who are saying thank you, and that’s what we wanted to do, to support others who agree and who are saying, ‘What you think is what we think.’ So they know they aren’t crazy.”

Emily Guskin contributed to this report.