Washington (CNN) The pastor of the Virginia church President Donald Trump visited following the mass shooting in Virginia Beach last week explained in a letter to "hurt" members of his congregation why he prayed for the President during the service Sunday, saying he did not intend to support the President or Republicans by doing so.

"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," Pastor David Platt of McLean Bible Church in Virginia, wrote in a letter , citing several Bible verses.

On Sunday, Trump -- having just left a golf outing in Virginia -- arrived at the church in golf clothes "to visit with the Pastor and pray for the victims and community of Virginia Beach," White House spokesman Judd Deere said in a statement.

During Trump's visit, there was no mention of the shooting in Virginia Beach on Friday that left 12 dead, and Trump did not provide remarks during his unannounced stop at the church.

CNN has reached out to the White House Tuesday for comment on Platt's letter.

Read More