WASHINGTON -- In a remarkable political repudiation, the Democratic-led U.S. House voted to condemn President Donald Trump's "racist comments" against four congresswomen of colour, despite protestations by Trump's Republican congressional allies and his own insistence he hasn't "a racist bone in my body."

Two days after Trump tweeted that four Democratic freshmen should "go back" to their home countries -- though all are citizens and three were born in the U.S.A. -- Democrats muscled the resolution through the chamber by 240-187 over near-solid GOP opposition. The rebuke Tuesday night was an embarrassing one for Trump even though it carries no legal repercussions, but if anything his latest harangues should help him with his die-hard conservative base.

Despite a lobbying effort by Trump and party leaders for a unified GOP front, four Republicans voted to condemn his remarks: moderate Reps. Brian Fitzpatrick of Pennsylvania, Fred Upton of Michigan, Will Hurd of Texas and Susan Brooks of Indiana, who is retiring. Also backing the measure was Michigan's independent Rep. Justin Amash, who left the GOP this month after becoming the party's sole member of Congress to back a Trump impeachment inquiry.

Democrats saved one of the day's most passionate moments until near the end.

"I know racism when I see it," said Rep. John Lewis of Georgia, whose skull was fractured at the 1965 "Bloody Sunday" civil rights march in Selma, Alabama. "At the highest level of government, there's no room for racism."

Before the showdown roll call, Trump characteristically plunged forward with time-tested insults. He accused his four outspoken critics of "spewing some of the most vile, hateful and disgusting things ever said by a politician" and added, "If you hate our Country, or if you are not happy here, you can leave !" -- echoing taunts long unleashed against political dissidents rather than opposing parties' lawmakers.

The president was joined by House Minority Leader Kevin McCarthy of California and other top Republicans in trying to redirect the focus from Trump's original tweets, which for three days have consumed Washington and drawn widespread condemnation. Instead, they tried playing offence by accusing the four congresswomen -- among the Democrats' most left-leaning members and ardent Trump critics -- of socialism, an accusation that's already a central theme of the GOP's 2020 presidential and congressional campaigns .

Even after two and a half years of Trump's turbulent governing style, the spectacle of a president futilely labouring to head off a House vote essentially proclaiming him to be a racist was extraordinary.

Underscoring the stakes, Republicans formally objected after Speaker Nancy Pelosi of California said during a floor speech that Trump's tweets were "racist." Led by Rep. Doug Collins of Georgia, Republicans moved to have her words stricken from the record, a rare procedural rebuke.

After a delay exceeding 90 minutes, No. 2 House Democrat Steny Hoyer of Maryland said Pelosi had indeed violated a House rule against characterizing an action as racist. Hoyer was presiding after Rep. Emanuel Cleaver of Missouri stormed away from the presiding officer's chair, lamenting, "We want to just fight," apparently aimed at Republicans. Even so, Democrats flexed their muscle and the House voted afterward by party line to leave Pelosi's words intact in the record.

In tweets Tuesday night, Trump took a positive view of the vote, saying it was "so great" that only four Republicans had crossed party lines and noting the procedural rebuke of Pelosi.

"Quite a day!" he wrote.

Some rank-and-file GOP lawmakers have agreed that Trump's words were racist, but on Tuesday party leaders insisted they were not and accused Democrats of using the resulting tumult to score political points. Among the few voices of restraint, Senate Majority Leader Mitch McConnell said Trump wasn't racist but also called on leaders "from the president to the speaker to the freshman members of the House" to attack ideas, not the people who espouse them.

"There's been a consensus that political rhetoric has gotten way, way heated across the political spectrum," said the Republican leader from Kentucky, breaking his own two days of silence on Trump's attacks.

Hours earlier, Trump tweeted, "Those Tweets were NOT Racist. I don't have a Racist bone in my body!" He wrote that House Republicans should "not show 'weakness"' by agreeing to a resolution he labeled "a Democrat con game."

Rep. Alexandria Ocasio-Cortez of New York, one of Trump's four targets, returned his fire.

"You're right, Mr. President - you don't have a racist bone in your body. You have a racist mind in your head and a racist heart in your chest," she tweeted.

And one of the leading 2020 Democratic presidential candidates, Sen. Kamala Harris of California, offered an impassioned response to Trump's racist tweets at a roundtable for women of colour in Davenport, Iowa, saying to applause, "And he needs to go back to where he came from."

The four-page Democratic resolution said the House "strongly condemns President Donald Trump's racist comments that have legitimized and increased fear and hatred of new Americans and people of colour." It said Trump's slights "do not belong in Congress or in the United States of America."

All but goading Republicans, the resolution included a full page of remarks by President Ronald Reagan, who is revered by the GOP. Reagan said in 1989 that if the U.S. shut its doors to newcomers, "our leadership in the world would soon be lost."

Tuesday's faceoff came after years of Democrats bristling over anti-immigrant and racially incendiary pronouncements by Trump. Those include his kicking off his presidential campaign by proclaiming many Mexican migrants to be criminals and asserting there were "fine people" on both sides at a 2017 neo-Nazi rally in Charlottesville, Virginia, that turned deadly.

And the strong words in Washington come as actions are underway elsewhere: The administration has begun coast-to-coast raids targeting migrants in the U.S. illegally and has newly restricted access to the U.S. by asylum seekers.

Trump's criticism was aimed at four freshman Democrats who have garnered attention since their arrival in January for their outspoken liberal views and thinly veiled distaste for Trump: Ocasio-Cortez and Reps. Ilhan Omar of Minnesota, Ayanna Pressley of Massachusetts and Rashida Tlaib of Michigan. All were born in the U.S. except for Omar, who came to the U.S. as a child after fleeing Somalia with her family.

The four have waged an increasingly personal clash with Pelosi over how assertively the House should try restraining Trump's ability to curb immigration. But, if anything, Trump's tweets may have eased some of that tension, with Pelosi telling Democrats at a closed-door meeting Tuesday, "We are offended by what he said about our sisters," according to an aide who described the private meeting on the condition of anonymity.

That's not to say that all internal Democratic strains are resolved.

The four rebellious freshmen backed Rep. Steven Cohen of Tennessee in unsuccessfully seeking a House vote on a harsher censure of Trump's tweets. And Rep. Al Green of Texas was trying to force a House vote soon on whether to impeach Trump, a move he's tried in the past but lost, earning opposition from most Democrats.

At the Senate Republicans' weekly lunch Tuesday, Trump's tweets came up and some lawmakers were finding the situation irksome, participants said. Many want the 2020 campaigns to focus on progressive Democrats' demands for government-provided health care, abolishing the federal Immigration and Customs Enforcement agency and other hard-left policies.

"Those ideas give us so much material to work with and it takes away from our time to talk about it," Sen. Mike Braun of Indiana said of Trump's tweets.

------

Associated Press writers Jill Colvin, Zeke Miller, Jonathan Lemire and Lisa Mascaro contributed to this report