WASHINGTON – The House formally condemned President Donald Trump’s Twitter posts as racist on Tuesday – in a vote split largely along party lines despite pressure for Republicans to denounce the president’s attacks on four Democratic congresswomen of color that they should "go back" to where they came from.

The vote on the resolution condemning a series of Trump’s remarks and Twitter posts came after a dramatic and combative hours-long debate that hit several snags due to long-standing House rules that prohibit any personal attacks on the president.

The vote, 240-187, fell nearly entirely along party lines with only four Republicans voting with Democrats. The four Republicans lawmakers are: Rep. Will Hurd of Texas, Rep. Brian Fitzpatrick of Pennsylvania, Rep. Fred Upton of Michigan and retiring Rep. Susan Brooks of Indiana. Rep. Justin Amash of Michigan, who recently left the GOP to become an independent, also voted in support of the resolution.

The resolution specifically called Trump's comments about "The Squad" — Reps. Alexandria Ocasio-Cortez, D-N.Y.; Ilhan Omar, D-Minn.; Ayanna Pressley, D-Mass.; and Rashida Tlaib, D-Mich. — "racist" and says the attacks have "legitimized fear and hatred of new Americans and people of color."

Everything we know:Trump triples down on his controversial tweets about 'The Squad.'

Reparations bill:Calling racism the 'poison of America,' Schumer backs reparations bill

The vote put Republicans on the record as to whether they denounced the president's comments or stuck beside him. Throughout Tuesday's debates Democrats aimed to pressure Republicans to hold Trump accountable while Republicans resisted, denouncing the resolution as a political ploy.

The intense debate over the president's rhetoric led to the House halting proceedings for nearly two hours after House Speaker Nancy Pelosi called Trump's comments “racist” and a top Republican asked her remarks be taken down.

"These comments from the White House are disgraceful and disgusting and these comments are racist," Pelosi said. "Every single member of this institution — Democratic and Republican — should join us in condemning the president’s racist tweets. To do anything less would be a shocking rejection of our values and a shameful abdication of our oath of office to protect the American people."

Editorial:Trump's racist rants are too offensive to overlook

As Pelosi called the president’s tweets racist, Rep. Doug Collins, R-Ga., tried to interrupt and cut off her speech. Pelosi only spoke louder, looking down at her prepared remarks.

After Pelosi was done, Collins looked wide-eyed at Pelosi and asked if she wanted to "rephrase that comment." Pelosi shot back: "I have cleared my remarks with the parliamentarian before I read them." House Democrats started cheering and clapping.

The move led to two hours of delay as officials debated over whether Pelosi violated House rules, which the House ruled she had. Rep. Emanuel Cleaver, D-Mo., who was presiding over the House floor at the time, abdicated his post due to the dramatic fighting on both sides.

"We don’t ever, ever want to pass up, it seems, an opportunity to escalate. That’s what this is,” he said, noting that he tried to remain fair. But, he said. “fairness isn’t enough. We want to just fight."

“I’ll abandon the chair,” Cleaver said, slamming the gavel on the dais and storming away as House officials watched in amazement.

The moment was replayed on loop on C-SPAN like a moment from an NFL game with reporters left with their jaws dropped remarking aloud whether this had happened before. A large crowd of journalists gathered in the gallery overlooking the House floor to watch the debate.

Rep. Jim McGovern, D-Mass., and chairman of the House Rules Committee, also got in a heated back-and-forth with Republicans after he attacked the president's comments in a speech as something that "used to be reserved for the darkest corners of the internet."

More on resolution:House resolution will condemn Trump's 'disgusting' attacks on AOC, Tlaib, Omar and Pressley

Trump should 'aim higher': Lindsey Graham and other Republicans respond to Trump's 'go back' tweets

"This is proudly using Twitter as a megaphone to attack fellow Americans," he said. "These are American citizens being turned into some kind of scary 'other,' not because of their party, but because of their background, their race and their opinions."

He added: "I implore my colleagues to think twice before you follow the president off a cliff."

Rep. Rob Woodall, R-Ga., took issue with McGovern's comments, saying they clearly violated rules and were "diminishing" the institution of the House of Representatives.

Pelosi told members of her caucus Tuesday morning she wasn't worried about House rules on calling out the president's comments, describing the four congresswomen as their "sisters" and saying Trump's "words were racist," according to an aide in the room.

She added that she hoped Republicans would join them in condemning the comments by voting in a bipartisan fashion for the resolution.

"If they can’t support condemning the words of the President, well that’s a message in and of itself," Pelosi said, according to the source.

Most Republicans did not condemn the president and Republican leaders in both the House and Senate refused to do so throughout the day Tuesday, alleging the outcry is over politics.

“Let’s not be false about what is happening here today,” said GOP minority leader Kevin McCarthy. “This is all about politics and beliefs of ideologies."

Senate Majority Leader Mitch McConnell declined to call the comments racist and specifically said "the president's not a racist."

"Our words do matter. We all know politics is a contact sport. But it's about time we lowered the temperature all across the board," said McConnell, R-Ky. "All of us ought to contribute to a better level of discourse."

After Tuesday's vote, Republicans said they felt the day was wasted talking about the president instead of working to settle issues that will help the American people.

"This resolution divides our nation and distracts us from addressing the issues the American people sent us here to solve," Republican Whip Steve Scalise, R-La., said. "It's time House Democrats start focusing on the real problems facing the American people, instead of their own."

Rep. Dan Newhouse, R-Wash., said the debate and chaos the resolution caused on the House floor left him "struggling." He said, to him, this debate "is not about race."

"It should be about the issues that we disagree on, trying to come together and find common ground," Newhouse said. "That’s what I’m looking forward to try to find some respectful discourse and some civility out of all this."

Along with the resolution, Rep. Steve Cohen, D-Tenn., introduced a measure that would censure Trump for his racist comments. Democrats aren't expected to take up the measure for a vote, instead hoping the resolution on Tuesday would garner bipartisan support.

Trump wrote on Sunday that it was "so interesting to see 'Progressive' Democrat Congresswomen, who originally came from countries whose governments are a complete and total catastrophe" now telling the U.S. how to run its government. He did not mention Ocasio-Cortez, Omar, Pressley or Tlaib by name.

"Why don’t they go back and help fix the totally broken and crime infested places from which they came," Trump wrote on Twitter. "Then come back and show us how it is done."

All four are American citizens. The four progressive freshmen lawmakers are some of the president's most vocal critics in the House and have become known as "The Squad" — sticking together even when they seem to go against the rest of their party on key votes and issues.

The president's tweets appeared to help unite House Democrats after weeks of infighting that exploded into the public last month over sending emergency money to border agencies running migrant detention centers.

The feud garnered headlines after Pelosi criticized members of "The Squad," telling New York Times columnist Maureen Dowd that the four congresswomen "have their public whatever and their Twitter world" but do not "have any following."

Ocasio-Cortez questioned why Pelosi would single out the new women of color in the caucus, telling the Washington Post it was "outright disrespectful."

The back-and-forth digs ended over the weekend after Trump's attacks. Instead, Democrats united against the president and denounced his comments.

More:'The Squad': These are the four congresswomen Trump told to 'go back' to other countries

The resolution not only condemns Trump's comments. It also highlights immigration as a centerpiece of American history and culture, quoting presidents throughout history and comparing them to the policies of the Trump administration, which has been heavily scrutinized due in part to the worsening conditions in migrant detention centers at the southern U.S. border.

"The commitment to immigration and asylum has been not a partisan cause but a powerful national value that has infused the work of many Presidents," the resolution reads. "American patriotism is defined not by race or ethnicity but by devotion to the Constitutional ideals of equality, liberty, inclusion, and democracy and by service to our communities and struggle for the common good."