Trump sat in the fifth row at the First Presbyterian Church in Muscatine, Iowa, attending the hour-long service along with his campaign manager and spokeswoman before heading to Muscatine High School for a campaign event.
At one point, The Associated Press reported
, Trump shared a prayer book with a woman seated to his right. The woman put her hand around Trump's waist as the congregation sang "God is Here!"
Trump later told reporters that the woman beside him was a supporter whose son was killed after returning from a tour of duty in the Middle East.
The pastor urged the congregation to embrace Syrian refugees and Mexican migrants, and another speaker urged humility, The Washington Post reported
"I also want you to think about how this keeps your significance from getting blow up into self-importance. For no matter how significant you are, it is only because of what you are part of," the woman speaker said.
Trump highlighted that message during his campaign stop at the high school afterward.
"Just got back from church and it was good, it was really good," he said. "I learned something. We talked about humility at church today, I don't know if that was aimed at me, perhaps. Now I don't think the church knew I was coming so maybe it was just by luck that we talked about humility."
Trump told reporters after the services that he has "more humility than people think."
He also said that church attendees did not know that he was planning to attend services there.
For Trump, his attendance could help him reach the religious voters who dominate Iowa's Republican caucuses. He's competing with Texas Sen. Ted Cruz for evangelicals' support.
Clinton, meanwhile, spoke to the congregation during a previously unannounced appearance at the Mt. Zion Missionary Baptist Church, a primarily African-American church in Cedar Rapids.
Sen. Cory Booker, a New Jersey Democrat who has endorsed Clinton, also attended.
Clinton talked about Martin Luther King, Jr. and love versus hate.
"When Dr. King talked about how hate was such a burden, it was just easier to love, I resonated with that. Love isn't easy either, but it is not as heavy a burden," she said.
She tied herself to President Barack Obama throughout the speech, saying that becoming secretary of state was "one of the best decisions I made, ever," adding that she prayed about whether to accept Obama's offer.
And she hammered Michigan officials' handling of the water crisis in Flint, saying that it "breaks my heart" to see families without clean water.
"I view this not just as an environmental disaster and a health crisis, this is a civil rights issue. I have said and I will repeat here today, if it had been a rich white suburb when the water was brown and smelly, people would immediately come to the rescue of those families," she said.