Joe Biden has condemned those who spread white supremacist lies "for power, political gain and for profit" during a visit to Buffalo, New York, where 10 people were killed in a racist shooting last Saturday.
The US president was close to tears as he recalled the victims' lives, then became angry as he described forces of hatred that have haunted his administration.
"In America, evil will not win, I promise you," Biden said. "Hate will not prevail and white supremacy will not have the last word."
The mass shooting shook a nation that can sometimes seem numbed to atrocities and marked an alarming convergence of racist extremism, gun violence and the radicalising effects of social media.
It also revealed the scale of the challenge facing Biden, who ran for president to restore "the soul of America" after his predecessor Donald Trump's failure to denounce a deadly white supremacist rally in Charlottesville, Virginia, and took office weeks after an assault on the US Capitol that included white nationalist groups.
Authorities say Payton Gendron, 18, opened fire with a semi-automatic rifle on Saturday at the Tops Friendly Market in a predominantly Black neighbourhood of Buffalo. He struck 13 people with gunfire, killing 10, and used a camera to live-stream the rampage.
Police have said they are investigating Gendron's online postings, which included a 180-page manifesto he was believed to have written outlining the "great replacement" theory, which baselessly claims white people are being intentionally overrun by other races through immigration or higher birthrates.
The "great replacement" theory has been dragged into the mainstream by some Republican members of Congress as well as Tucker Carlson, the most watched prime-time host on Rupert Murdoch's Fox News network.
In emotional and pointed remarks in Buffalo, Biden did not name names but made clear that such violence takes place in a wider political context. "What happened here is simple and straightforward terrorism," he said. "Terrorism. Domestic terrorism. Violence inflicted in the service of hate and a vicious thirst for power that defines one group of people being inherently inferior to any other group. Hate.
"And through the media and politics the internet has radicalised angry, alienated lost and isolated individuals into falsely believing that they will be replaced - that's the word, replaced - by the other. By people who don't look like them and who are therefore, in the perverse ideology that they possess and are being fed, lesser beings. I and all of you reject the lie."
He added to applause: "I call on all Americans to reject the lie and I condemn those who spread the lie for power, political gain, and for profit."
In recent years America has witnessed mass shootings driven by racist hatred in Charleston, El Paso, Pittsburgh, Atlanta and Dallas, Biden noted.
"White supremacy is a poison," Biden said. "It's a poison - it really is - running through our body politic, and it's been allowed to fester and grow right in front of our eyes. No more. I mean, no more. We need to say as clearly and forcefully as we can that the ideology of white supremacy has no place in America. None. Look, failure to say that is going to be complicity. Silence is complicity. It's complicity. We cannot remain silent."
The president also warned: "The American experiment in democracy is in a danger like it hasn't been in my lifetime. It's in danger this hour. Hate and fear are being given too much oxygen by those who pretend to love America but who don't understand America. To confront the ideology of hate requires caring about all people, not making distinctions."
Earlier, Biden and his wife, Jill, laid a bouquet of white flowers at a makeshift memorial of blossoms, candles and messages of condolence set up under a tree outside the Tops supermarket.
New York's governor, Kathy Hochul, and Buffalo's mayor, Byron Brown, greeted the Bidens and the state's two senators.
The president, who publicly grieved the 2015 death of his son, weathered other significant personal losses and is often lauded for his empathy, once again found himself in the role of consoler-in-chief. "It's not the same but we know a little bit what it's like to lose a piece of your soul," he said.
After visiting the supermarket, the Bidens went behind closed doors at the Delavan Grider Community Center and met the families of the victims.
Ruby Davis, an elderly woman standing behind police lines two blocks from Tops, said: "He's coming to show love because there's so much hatred around."
But more than love and support, residents said, they want action. Cherell Toe, 50, said: "If laws don't change it's giving permission for this to continue and it sends the message that there's no consequences for your actions - for taking a life based on your colour or race."
The president of the National Association for the Advancement of Colored People (NAACP), Derrick Johnson, told the Associated Press: "It's important for him to show up for the families and the community and express his condolences. But we're more concerned with preventing this from happening in the future."
Yet the trip underlined how far Biden still has to go in stamping out a rise in white supremacist groups or improving gun safety. A record 45,222 people died from gun-related injuries in the US in 2020, according to the Centers for Disease Control and Prevention.
Biden has asked Congress to require new background checks for gun buyers and ban military-style "assault" weapons and large-capacity ammunition magazines. But the efforts have been blocked by congressional Republicans.
Republicans' drift to the far right has also come under renewed scrutiny. Liz Cheney, one of the few Republicans in the House of Representatives to break from Trump, tweeted that her own party's leaders have "enabled white nationalism, white supremacy, and antisemitism. History has taught us that what begins with words ends in far worse."
Barack Obama tweeted: "We need to repudiate in the strongest terms the politicians and media figures who - whether for political gain or to boost ratings - have used their platforms to promote and normalize 'replacement theory' and other starkly racist, antisemitic, and nativist conspiracy theories."
On Tuesday the Democratic majority leader in the Senate, Chuck Schumer, sent a letter to Murdoch and other senior Fox News executives urging them "to immediately cease the reckless amplification of the so-called 'Great Replacement' theory on your network's broadcasts".
A White House national security council spokesperson said the Biden administration was implementing a "government-wide national strategy to counter domestic terrorism, which President Biden directed his national security team to develop on his first full day in office, recognizing that has evolved into the most urgent terrorism threat the United States faces today".
A top FBI official told Congress in November that the bureau was conducting about 2,700 investigations related to domestic violent extremism, and the justice department said in January it was creating a new unit to counter domestic terrorism.