A Northern Virginia pastor who prayed for Donald Trump during the president’s apparently impromptu Sunday visit to the McLean Bible Church is defending his actions amid controversy among the congregation.

In a statement released later on Sunday, Rev. David Platt called the situation one he “didn’t see coming,” saying that he was notified at the end of his afternoon sermon that Trump would be arriving within minutes and had requested the prayer.

Platt noted that “some within our church, for a variety of valid reasons, are hurt that I made this decision.”

“This weighs heavy on my heart,” he said, adding that he hopes his work “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.”

The pastor also said the prayer he read was not intended as a political message.

“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 to govern in the way this passage portrays.”

Platt’s interaction with the president occurred on what evangelical Trump supporter Rev. Franklin Graham had designated as “Pray for Donald Trump Day.”

Graham pitched the idea last month in a Facebook post decrying Trump’s “enemies” who “continue to try everything to destroy him, his family, and the presidency.”

“In the history of our country, no president has been attacked as he has,” Graham wrote. “I believe the only hope for him, and this nation, is God.”

Trump, who arrived at the church after having played at the golf course he owns in nearby Sterling, Virginia and was attired in khakis, a golf polo shirt and golf shoes, made no public remarks during his visit. He stood silently on the stage with his head bowed as Platt prayed.

A White House spokesman said one reason for Trump’s stop was to offer prayer for the victims of Friday’s mass shooting in Virginia Beach, Virginia. But Platt’s prayer offered no mention of that massacre, in which a gunman killed 12 people before being slain by police.