FLINT, Mich. — Donald Trump was cut off, chastised and then heckled after he attacked rival Hillary Clinton during what was supposed to be a speech on helping where the government had failed the people of Flint, Michigan.

“Mr. Trump, I invited you here to thank us for what we’ve done in Flint, not give a political speech,” said the Rev. Faith Green Timmons, the pastor of the Bethel United Methodist Church.

The Republican nominee quickly stopped, then said “Ok, that’s good, then I’m going to go back to Flint” and its water crisis that had sickened its citizens.

But the interruption seemed to embolden those in the sparse crowd. One woman shouted that Trump had used discriminatory housing practices in his buildings, causing the celebrity businessman to respond, “Never, you’re wrong. Never would.”

Trump abruptly ended his speech, which had lasted six minutes. More heckling followed him out.

Flint residents Josephine Thornton,  Melva Lewis and Juanita Young-Wells (left to right in center), shout out in unison as they chant against Donald Trump at a gas station where more than 100 people gathered to support, protest and try to catch a glimpse of him on Wednesday, Sept. 14, 2016. | Jake May/The Flint Journal-MLive.com via AP

Flint residents Josephine Thornton, Melva Lewis and Juanita Young-Wells (left to right in center), shout out in unison as they chant against Donald Trump at a gas station where more than 100 people gathered to support, protest and try to catch a glimpse of him on Wednesday, Sept. 14, 2016. | Jake May/The Flint Journal-MLive.com via AP

The visit was part of the campaign’s effort to persuade voters that the celebrity businessman can appear empathetic and presidential in a crisis. Trump also has his eye on a good showing in the industrial Midwest, though polls have him down in Michigan, which last went Republican in 1988.

The trip was the Republican presidential nominee’s first visit to the poverty-stricken city since lead was detected in its water supply in April 2014. More than 100,000 had water that was contaminated after the city left Detroit’s water supply and started using improperly treated Flint River water.

Trump did address the crisis, saying at the church “We will get it fixed and it will be fixed and effectively and Flint will come back. Most importantly, we’ll bring jobs back.”

He also bemoaned that previously “cars were made in Flint and you couldn’t drink the water in Mexico. Now cars are made in Mexico and you can’t drink the water in Flint.”

Trump visited the traditionally African-American church in the impoverished city to pay tribute to the city’s resiliency. But then he attacked Clinton, saying “everything she touched didn’t work out.”

Timmons then stepped up and interrupted him.

Others began to heckle the GOP presidential nominee. The pastor stepped in and silenced them too, saying that Trump “is our guest” who should be honored.

But when Trump abruptly ended his speech, a few more in the crowd yelled at him as he walked off stage.

One black woman, Reneta Richard, yelled at him “What do you mean, ‘African-Americans have nothing to lose?’ ” repeating back to Trump his recent call for African-Americans to turn their back on Democrats and vote for him.

The reverend had said in a statement distributed to reporters that the visit “in no way” represented an endorsement of Trump’s candidacy.

“What we pray is that it conveys a fine example of a faithful, intelligent, historically African-American congregating at work, serving and volunteering among the people of Flint as we work through this crisis of national impact,” the statement said. “We cannot let this story drift from national attention for any reason.”

But later at a rally in Ohio, Trump insisted he was undeterred by the tough reception and would be “willing to campaign anywhere, even if voters openly oppose me somewhere.”

“Some people in those communities aren’t planning on voting for me and that’s OK — I will be the president for all Americans,” Trump said in front of rowdy crowd of about 5,000 people in Canton. “I’m running to bring hope to Flint.”

The visit to Flint, where most residents are African-American, comes as Trump has increased his outreach to minorities, arguing that Democratic policies have left inner cities impoverished and dangerous.

Critics say Trump paints an overly bleak picture of life in urban African-American communities, where crime has fallen and the life expectancy has risen in recent decades. Some black leaders also have suggested that Trump’s outreach to minorities is mostly about proving to undecided white voters that he’s not racist.