Far more than a typical Republican presidential candidate, Mr. Trump faces a wall of opposition from nonwhite voters. He records virtually no support from black voters in the polls. Their resistance has emerged as one of the most important impediments to Mr. Trump’s candidacy, threatening to put several major swing states, like Michigan and Pennsylvania, entirely out of reach.

Mr. Trump’s appearance on Saturday, long billed by campaign aides as a pivotal opportunity to reintroduce himself to black voters, was swathed in uncertainty up to the last minute, as the Trump campaign and the pastor deliberated over whether the Republican nominee would actually speak at the church. Plans for stops in nearby neighborhoods were announced, then retracted; Mr. Trump ultimately paid a short visit to Mr. Carson’s childhood home before flying out of Detroit.

And a scheduled interview with Mr. Jackson, Mr. Trump’s host on Saturday, became a source of embarrassment when it was revealed that both the questions and Mr. Trump’s answers had been scripted in advance. Mr. Trump taped the television appearance before the church service on Saturday, and it is expected to air in the next few days on Mr. Jackson’s Christian cable network.

Mr. Jackson acknowledged offhand the unusual spectacle of Mr. Trump’s presence in his church. Introducing Mr. Trump, Mr. Jackson noted with a chuckle, “This is the first African-American church he’s been in.”

Mr. Jackson had planned to let Mr. Trump speak for just one minute, but at a reception before the service, aides to Mr. Trump asked Mr. Jackson for more time, and he granted it.