When David Platt concluded his sermon during an afternoon service at McLean Bible Church in Northern Virginia on Sunday, the pastor thought he would have a few minutes to himself for quiet reflection.

Instead, he was whisked backstage and given a message: “The president of the United States was on his way to the church, would be there in a matter of minutes, and would like for us to pray for him."

Unlike other pastors who have fiercely supported President Trump, Platt, known for his nonpartisan approach to preaching, found himself facing a tough decision. After ultimately choosing to bring Trump onstage and fulfill the president’s request, Platt felt he owed his congregation a lengthy explanation for his reasoning, even acknowledging that “some within our church . . . are hurt that I made this decision.”

In a detailed letter posted on the nondenominational megachurch’s website Sunday evening and shared by Platt to social media on Monday, the pastor wrote, “My aim was in no way to endorse the president, his policies, or his party, but to obey God’s command to pray for our president and other leaders."

The letter, which was addressed to Platt’s “church family,” comes at a time when evangelicals nationwide are becoming increasingly divided over supporting a president whose personal actions and policies, some critics say, fail to align with Christianity’s core beliefs.

For anyone familiar with Platt’s history, seeing him standing next to Trump onstage Sunday was an unusual sight. Platt, who has been a pastor at McLean Bible Church for two years, is best known for authoring the New York Times best-selling book, “Radical: Taking Back Your Faith from the American Dream,” in which he calls out materialism. According to the Christian Post, Platt has also preached that churches shouldn’t promote nationalism. Before coming to the Washington-area church, Platt served as the president of the Southern Baptist Convention’s International Mission Board.

On Sunday, Trump caught Platt, churchgoers and reporters by surprise when he made the unscheduled 15-minute stop on his way back to the White House after spending the morning at Trump National Golf Course in Sterling.

“Sometimes we find ourselves in situations that we didn’t see coming, and we’re faced with a decision in a moment when we don’t have the liberty of deliberation, so we do our best to glorify God,” Platt wrote in the letter. “Today, I found myself in one of those situations.”

Platt declined to comment for this story.

Video of Sunday’s service showed Platt reemerging in front of his congregation followed by a casually dressed Trump, who appeared to still be wearing his golf shoes. The pastor informed those in attendance that the church had been presented with a “unique opportunity.”

“We in this city have a unique opportunity to pray for leaders who are part of this church and leaders who stop in unexpectedly to this church,” he said, drawing laughs from the crowd and Trump. “We count it an honor to be able to pray for any leader in any position. Any leader from any party, including our current president.”

White House spokesman Judd Deere said in a statement Sunday that Trump went to the church to “visit with the Pastor and pray for the victims and community of Virginia Beach.” On Friday, a gunman opened fire at a municipal complex in the coastal city, killing 12 people and leaving several others injured.

During the roughly five minutes that Trump was onstage at the church and in Platt’s letter, there was no mention of the shooting or its victims. But ahead of his Sunday remarks, Platt did reference prominent evangelist the Rev. Franklin Graham’s recent declaration that June 2 be a “special day of prayer for the President, Donald J. Trump.”

“Many of you may have seen that there was a call to, particularly on this Sunday, pray for our president,” Platt said. “We don’t want to do that just on this Sunday, we want to do that continually, day in and day out.”

Platt then walked over to a smiling Trump and placed a hand on the president’s back.

“I want to ask us to bow our heads together now and pray for our president,” he said.

For the next several minutes, Platt delivered a lengthy prayer in which he asked God to bestow grace, mercy and wisdom on Trump. Platt also included prayers for other national and state leaders, including those in Congress and the courts.

When Platt finished speaking, people in attendance broke out in loud cheers. Trump did not make any comments, but shook hands with Platt and mouthed “Thank you . . . I really appreciate it.” As the president walked offstage, he paused several times to wave at the crowd and thank them as well.

Platt wrote in the statement that when he was informed of Trump’s plans, he recalled a passage from the Bible that in part states, “I urge that supplications, prayers, intercessions, and thanksgivings be made for all people . . . for kings and all who are in high positions, that we may lead a peaceful and quiet life, godly and dignified in every way.”

“Based on this text, I know that it is good, and pleasing in the sight of God, to pray for the president,” he wrote.

Sunday was not the first time Platt has grappled with navigating faith and politics in the Trump era. Former White House communications aide Cliff Sims told Christianity Today in February that Platt had been “conflicted” about possibly speaking at a White House prayer breakfast.

“I think one of the reasons for this hesitation was because when pastors get involved in the political space in a public way, there are drawbacks and it can put pastors in a position where people suddenly view them through a political lens,” Sims said. “There’s just a lot of baggage that comes along with such a decision.”

White evangelical voters were a driving force behind Trump’s victory in the 2016 election, and have remained stalwart supporters of the president despite his tenuous relationship with Christian values. But as recent Gallup data suggests, that may have more to do with the fact that most white evangelicals identify as Republican, The Washington Post’s Philip Bump reported in April.

Within the greater community of Americans who are self-described evangelicals, a group that accounts for about a quarter of the population, there is a divide that "appears to be widening under Trump,” FiveThirtyEight reported in March 2018. In April, Vice President Pence, an evangelical Christian, faced a mounting protest by students from Taylor University, a religious school in his home state of Indiana, after he was selected as their commencement speaker.

According to FiveThirtyEight, the split can be attributed to two factors: the evangelical community becoming more diverse and Trump’s actions as president.

“His governing style is, in effect, forcing evangelical leaders to choose between embracing the white evangelicals who overwhelmingly support the president or distancing themselves from the president — and even politics generally — as part of an appeal to their diversifying congregations,” the site wrote.

While speaking at Sunday’s service and in his letter, Platt repeatedly mentioned the diversity represented within his church’s members.

“We just talked about how what unites us in this room is not our ethnicity, not our background, not our politics,” he said ahead of the prayer. “What unites us in this room is the gospel of Jesus Christ.”

Platt wrote that knowing some people were unhappy with his decision to publicly pray for Trump “weighs heavy on my heart.”

“I love every member of this church, and I only want to lead us with God’s Word in a way that transcends political party and position, heals the hurts of racial division and injustice, and honors every man and woman made in the image of God,” he wrote. “I don’t want to purposely ever do anything that undermines the unity we have in Christ.”