SAN DIEGO — Hours after President Trump called on the nation to “condemn racism, bigotry, and white supremacy” following massacres in Texas and Ohio, Democratic presidential candidates and Latino leaders did exactly that — and their condemnation was aimed at Trump himself, who they said is responsible for spreading those sentiments with his rhetoric.

Many of them issued those rebukes at the annual convention for UnidosUS, the largest Latino civil rights and advocacy group in the country. Although the organization scheduled its forum for presidential candidates long before the violent weekend, it provided a venue for the discussion of racism, rhetoric and the president — and the five Democratic candidates who attended seized the moment.

“The attack we saw in El Paso two days ago was the result of hate and bigotry,” said former secretary of housing and urban development Julián Castro, the only Latino candidate in a Democratic field of more than 20.

“For four years now, since he launched his campaign, Donald Trump has made hate and bigotry and division a political strategy,” Castro said in San Diego. “The attack two days ago was an attack on the Latino community. It was an attack on immigrants. It was an attack on Mexicans and Mexican Americans. And that was no accident. That is due in part to the climate this president has set.”

Castro, former vice president Joe Biden, and Sens. Bernie Sanders (I-Vt.), Kamala D. Harris (Calif.) and Amy Klobuchar (Minn.) all dedicated at least a portion of their remarks to a roomful of activists from a critical voting bloc to condemning the president and tying his words to the shooting in El Paso.

Trump and his supporters reject the idea that he is racist. His remarks that often come under scrutiny, they say, are policy critiques or messages on subjects such as immigration and urban affairs, not aimed at particular racial or ethnic groups.

Biden, however, told the crowd that while he had planned to talk about a variety of issues Monday, “in light of a weekend of the grief and horror so many people had to withstand,” he was changing his message. He addressed part of his speech directly to Trump, saying it was “long past time to stand up to” what he called “white nationalism,” “white supremacy” and “hate.”

“The policies of this administration amount to nothing but an onslaught on decent, decent Americans and citizens and those who are seeking to be citizens,” Biden said.

Sanders called on Senate Majority Leader Mitch McConnell (R-Ky.) to reconvene the Senate in the wake of the shootings and said McConnell should “stop allowing the NRA to dictate gun policy in America.”

Then he, too, went after the president. “Today I say to Donald Trump: Stop your anti-immigrant rhetoric,” Sanders said. “Stop the hatred. Because that language, that hatred, that divisiveness creates a situation where certain people will do terrible things.”

It is not unusual for candidates to blast a president from the opposing party. But the spectacle of one party’s leaders saying a sitting president paved the way for a mass shooting highlights the hostile, fractured nature of this political moment.

Harris at one point indicated her microphone to convey one of the presidency’s most powerful tools.

“The current occupant of the White House has used this in a way that has been about beating people down instead of lifting people up,” she said. “But we are better than this, and we are going to help him get out of the White House and go back to his reality TV show or wherever he came from.”

That was a not-so-subtle reference to Trump’s recent remark that four minority congress­women should “go back” to the countries their ancestors came from.

In the past Unidos has hosted candidates from both parties, but its leaders chose not to do so Monday. The organization’s president, Janet Murguía, opened the forum by telling the audience she hopes that “someday soon we’ll be able to host presidents and candidates from both parties again.”

Earlier, Murguía told reporters that Trump should apologize for fostering a divisive climate, and said she believes his words motivated the El Paso shooter.

“Hateful words have hateful consequences,” Murguía said. “We’re seeing the direct impact of his promotion of a climate of fear and hate and division taking hold in our country. And we want to make sure that he understands that he has to take some ownership over this.”

Her remarks preceded the unveiling of a Unidos survey of Latino voters in which 78 percent said their top concern ahead of the 2020 presidential election is the way “Trump and his allies treat immigrants and Latinos,” and the fear that it might get worse.

The poll was taken before a authorities said a gunman drove hours to El Paso to target Latinos, apparently after writing a manifesto that said that “immigration can only be detrimental to the future of America.”

Clarissa Martinez, vice president of civic engagement for Unidos, said Trump is not the first politician to use immigration as “a proxy” for racist politics, but argued that he is drawing a clearer line than those before him.

“I think what the president has done . . . is that he tore away the veneer under which some politicians might have been able to hide to in the past, and has made very clear what this is about,” Martinez said.

The result, she added, citing the group’s polling, is that the Latino electorate — which cast 12 million votes in the 2016 presidential election and will soon pass African Americans as the largest minority group in the nation — is supporting Democrats at higher percentages than ever.

“Latinos are not a monolith, which is why it is actually so surprising to see the incredible level of affinity, as you have seen in all of the issues and candidate traits,” Martinez said. “Latinos care about substance. That’s one of the reasons that you have seen across the decades a very strong ticket-splitting tendency among Latinos in any given state.”

African Americans have often considered one of the more influential groups in the Democratic primary. According to Martinez, more than 80 percent of registered Latino voters normally vote, which she argued makes them a prime target for candidates hoping to generate turnout in the primaries or general election.

“We’d like to hear what they believe they can do to address [divisiveness] now and if they become president,” Murguía said. “One of the things that Latino voters are hungry for is a candidate who recognizes that diversity is a strength for this country. And they’re equally hungry for someone who can unite us as a country.”

Many Democratic candidates for president, including those not at the Unidos event, spent the day blaming the man they believe is dividing the country and creating a climate that helped lead to the shooting.

While Sen. Cory Booker of New Jersey campaigned in South Carolina on Monday, his campaign manager Addisu Demissie tweeted a text he said he received from Booker during the president’s speech.

“Listening to the President. Such a bulls--- soup of ineffective words. This is so weak. We should quickly condemn his lack of a real plan,” the text said.

Sen. Elizabeth Warren of Massachusetts tweeted a video of the speech, in which Trump suggested mental-health issues were the underlying cause of mass shootings, and argued against that notion.

“White supremacy is not a mental illness. We need to call it what it is: Domestic terrorism,” she wrote. “And we need to call out Donald Trump for amplifying these deadly ideologies.”

Her rivals at the Unidos forum also fielded questions about their health-care plans, criminal justice overhauls, plans for Puerto Rico and other subjects. But the topic of the day was clear, and none of the five candidates strayed from that focus for long.

Biden, as he concluded his remarks, said, “None of this works if we don’t get rid of Donald Trump.”

Correction: An earlier version of this story misspelled the name of the president of UnidosUS. She is Janet Murguía, not Janet Marguía.