About half of registered voters believe President Trump is racist, according to a new national poll released Tuesday, which showed voters are sharply divided along partisan lines on the question.

The survey was conducted by Quinnipiac University from July 25 to 28, several days after Mr. Trump said that a group of four congresswomen of color should “go back” to the countries they came from, even though all four are American citizens and three were born in the United States. The survey period also included the day that the president launched a new attack on Representative Elijah E. Cummings, a leading black congressman, calling him “a brutal bully” whose Baltimore-area district he characterized as a “disgusting, rat and rodent infested mess.”

The poll results come as Democrats seeking the party’s nomination for president prepare for a second round of debates, beginning Tuesday night in Detroit. Nearly all of the 2020 candidates have roundly condemned Mr. Trump’s remarks as racist and divisive.

The Quinnipiac poll found that 51 percent of voters think Mr. Trump is racist while 45 percent do not. When separated by party, 86 percent of Democratic voters classified Mr. Trump as racist while 91 percent of Republicans said he was not.