Twitter’s new policy for holding powerful leaders to account for engaging in hate speech and harassment received its first major test this weekend when President Trump called on several Democratic members of Congress to “go back” to their countries — prompting widespread allegations of racism against women of color.

Twitter said Monday that the president’s tweets didn’t violate its policies, but independent researchers who study social media said they struggled to see why. The platform bars attacks on people on the basis of their race, ethnicity or national origin.

Researchers say that Trump invoked national origins and, implicitly, race and ethnicity in attacking Reps. Alexandria Ocasio-Cortez (N.Y.), Rashida Tlaib (Mich.), Ayanna Pressley (Mass.) and Ilhan Omar (Minn.). He said of them, “Why don’t they go back and help fix the totally broken and crime infested places from which they came. Then come back and show us how . . . it is done. These places need your help badly, you can’t leave fast enough.”

Ocasio-Cortez, Pressley and Tlaib were born in the United States. Omar came to the United States from Somalia as a child and is a naturalized citizen. At a Monday news conference the congresswomen called Trump’s tweets “racist” and a “distraction.”

Twitter announced last month that it would label posts from world leaders when they violate company standards. Ordinary users are subject to more serious discipline, including potential deletion of their accounts, in such situations. Twitter portrayed the policy as an attempt to limit the reach of offensive content while preserving the right of its users to access the statements of their political leaders.

Researchers who study hate speech and harassment on social media, as well as activists who monitor how the platforms handle such issues, said that in Twitter’s first important test of its new policy, it had failed.

“It’s clear that this stuff violates their rules. They should at least label it,” said researcher Heidi Beirich, director of the Southern Poverty Law Center’s Intelligence Project. “I think Twitter should decide what their community standards are and enforce them, even when it’s Trump.”

A Twitter spokesman, Brandon Borrman, said Monday, “The tweets in question are not in violation of the Twitter Rules.”

He declined to elaborate on why the tweets did not violate company policies.

The company long has struggled to determine how to apply its policies in cases involving Trump and other world leaders and appeared to have taken steps toward resolving that dilemma with its new policy announced in June. But Trump’s latest tweets — and Twitter’s decision not to label them — have raised new questions about how the company intends to enforce its new policy while also underscoring the difficult cultural and political battles inherent in policing political speech.

The White House, which last week hosted a social media summit featuring claims that technology companies engaged in political bias, declined to comment. Trump reiterated his claims about the congresswomen — who are a liberal group known as “the squad” — in a new series of tweets Monday in which he demanded an apology and accused the members of Congress of stoking “racist hatred.”

Trump tweeted Monday: “So many people are angry at them & their horrible & disgusting actions!” He has nearly 62 million followers on the platform.

Twitter’s policy says, “You may not promote violence against or directly attack or threaten other people on the basis of race, ethnicity, national origin, sexual orientation, gender, gender identity, religious affiliation, age, disability, or serious disease.”

Brandi Collins-Dexter, of the advocacy group Color of Change, said, “Trump’s consistent targeting and abuse of women of color in Congress is not only vulgar, reckless and shameful — it’s flat out dangerous. Twitter choosing not even to label his content … is just more proof they can’t be serious about fixing a problem of their own making.”

Malkia Devich-Cyril, executive director of advocacy group MediaJustice, called Trump’s tweets “absolutely racist” for evoking misleading tropes about the heritages of nonwhite people and questioning whether they are authentically American even when they are citizens and, in the cases of the members of Congress, democratically elected representatives of their districts. Suggestions that they “go back” to their countries also echo the racist taunt of “go back to Africa.”

Devich-Cyril said that Twitter’s inaction suggested it was more concerned about provoking Trump’s ire than with protecting its platform and its users from racist attacks, raising questions about whether the company was serious about labeling tweets that violated its policies.

“They have taken no such action against these brutally racist attacks,” Devich-Cyril said. “So I have to wonder: What would it take? What would he have to say to fall within the scope of their policies?”

Summer Lopez, a senior director at PEN America, a nonprofit group that advocates for First Amendment protections, said she thought Trump’s tweets should be subject to the labeling policy but defended Twitter’s decision to preserve the tweets online because “the public has the right to know that this is what the president of the United States thinks . . . (and) to recognize that public figures’ words do have consequences, and can be especially powerful."

Twitter’s decision-making, Lopez said, also highlighted why some free-speech advocates are reluctant to call for the company to more aggressively police its content. “We don’t want to empower the tech companies to be these moral arbiters or global censors of what language is or isn’t acceptable,” she said. “You have these massive institutions with massive power, and they’re going to decide what is racist and what’s not? . . . There’s so much potential for unwanted censorship."

But Joan Donovan, director of the Technology and Social Change Research Project at Harvard Kennedy School’s Shorenstein Center, said of Sunday’s tweets, “It’s the first major test of their rules, and we’re all left wondering why they even set them up in the first place?"

She expressed concern that Twitter had been cowed by attacks from Trump and other Republicans into permitting behavior from powerful figures, even when it breaks the rules.

"By Trump alleging there was widespread censorship of conservatives, that maneuver really forced Twitter into a corner, to where they’re not able to execute on this policy, especially when you have the most high-status Twitter user in the fray,” she said. “They know there’s a real reputational risk to doing anything like moderating the president’s Twitter account.”

Trump’s original tweets from Sunday said, “So interesting to see ‘Progressive’ Democrat Congresswomen, who originally came from countries whose governments are a complete and total catastrophe, the worst, most corrupt and inept anywhere in the world (if they even have a functioning government at all), now loudly and viciously telling the people of the United States, the greatest and most powerful Nation on earth, how our government is to be run.”