When the House voted Tuesday night to formally denounce President Trump's racist tweets, only four Republicans voted in favor of the resolution. All four come from states that Mr. Trump won in the 2016 election.

Reps. Susan Brooks of Indiana, Brian Fitzpatrick of Pennsylvania, Will Hurd of Texas and Fred Upton of Michigan joined every Democrat in the House in supporting the measure to condemn the president's tweets, which attacked four Democratic congresswomen of color. Rep. Justin Amash of Michigan, a conservative who left the Republican Party this month after saying that Mr. Trump had engaged in impeachable conduct, also voted in favor of the resolution.

The resolution passed 240-187 after fierce debate on the House floor. It says that the president's "racist comments" have "legitimized and increased fear and hatred of new Americans and people of color." Mr. Trump had tweeted that the four congresswomen should "go back" to their countries, even though three were born in the U.S. and the fourth became a U.S. citizen as a teen.

Get Breaking News Delivered to Your Inbox

This is what the four Republicans said about their votes:

Susan Brooks, R-Indiana

The Indiana congresswoman, who is not running for reelection in 2020, was one of the few Republicans in Congress to speak out against Mr. Trump's remarks the day before the House vote.

"The lack of civility between the executive and legislative branches has reached an unacceptable low," she tweeted Tuesday night, calling the president's comments "racially offensive."

Yesterday, I issued a statement regarding the President’s recent inappropriate remarks because I believe they do not reflect American values. I believe our diverse backgrounds as Americans make our country greater and stronger. These differences should be celebrated by all of us. — Susan W. Brooks (@SusanWBrooks) July 17, 2019

Brian Fitzpatrick, R-Pennsylvania

The Pennsylvania congressman said that the "'Hatfield versus McCoy' brand of politics" has to end. "The language and tone being used by so many in our country needs to change," he tweeted.

"Democrats and Republicans need to start treating each other respectfully and like human beings. We are all created in the image and likeness of God."

The language and tone being used by so many in our country needs to change. The Hatfield versus McCoy brand of politics must end. Democrats and Republicans need to start treating each other respectfully and like human beings. We are all created in the image and likeness of God. — Brian Fitzpatrick (@RepBrianFitz) July 16, 2019

Will Hurd, R-Texas

The Texas congressman said there is "no room in America for racism, sexism, antisemitism, xenophobia and hate." While saying he supported the measure, he also criticized House Speaker Nancy Pelosi for not moving as fast to bring a resolution condemning remarks from one of her fellow Democrats, Rep. Ilhan Omar of Minnesota.

"Here's a novel concept: Maybe our elected officials should try to be role models to future generations. A first step: don't be anti-Semitic or racist. That way we spend less time rehashing lessons we learned in kindergarten and more time talking about threats facing our nation," Hurd tweeted.

There is no room in America for racism, sexism, antisemitism, xenophobia and hate. I voted to condemn the President's tweets today but I hope that Speaker Pelosi also considers holding members of her own party accountable to the same degree to which she holds the President. — Rep. Will Hurd (@HurdOnTheHill) July 16, 2019

Fred Upton, R-Michigan

The Michigan congressman said the resolution targeted words "that frankly are not acceptable from a leader in any work place large or small."

"If we're going to bring civility back to the center of our politics, we must speak out against inflammatory rhetoric from anyone in any party anytime it happens," Upton wrote on Twitter. He also posted a quote from President Ronald Reagan about the importance of America embracing immigrants.