President Joe Biden mourned with Buffalo's grieving families, then exhorted the nation to reject what he angrily labelled the poison of white supremacy.
He said the nation must "reject the lie" of the racist "replacement theory" espoused by the shooter who killed 10 black people in Buffalo.
Speaking to victims' families, local officials and first responders, Biden said America's diversity is its strength and warned that the nation must not be distorted by a "hateful minority".
"The American experiment in democracy is in danger like it hasn't been in my lifetime," Biden said. "It's in danger this hour. Hate and fear being given too much oxygen by those who pretend to love America but who don't understand America."
He declared: "In America, evil will not win, I promise you. Hate will not prevail, white supremacy will not have the last word."
Biden's emotional remarks came after he and first lady Jill Biden paid their respects at a makeshift memorial of blossoms, candles and messages of condolence outside the Tops supermarket, where on Saturday a young man armed with an assault rifle targeted black people in the deadliest racist attack in the US since Biden took office.
"Jill and I have come to stand with you, and to the families, we have come to grieve with you," Biden said.
"Now's the time for people of all races, from every background, to speak up as a majority ... and reject white supremacy."
Replacement theory is a racist ideology, which has moved from white nationalist circles to the mainstream, that alleges white people and their influence are being intentionally "replaced" by people of colour through immigration and higher birth rates.
In Buffalo, the President was confronting anew the forces of hatred he frequently says called him back to seek the White House.
"It's important for him to show up for the families and the community and express his condolences," said Derrick Johnson, the president of the NAACP. "But we're more concerned with preventing this from happening in the future."
It's unclear how Biden will try to do that. Proposals for new gun restrictions have routinely been blocked by Republicans, and racist rhetoric espoused on the fringes of the nation's politics has only grown louder.
Asked about gun legislation, Biden said at the airport, "It's going to be very difficult. ... I'm not going to give up trying."
Biden's condemnation of white supremacy is a message he has delivered several times since he became the first president to specifically address it in an inaugural speech, calling it "domestic terrorism that we must confront". However, such beliefs remain an entrenched threat at a time when his administration has been focused on addressing the pandemic, inflation and the war in Ukraine.
In his remarks, Biden paid tribute to each of the 10 people who lost their lives, describing them as model citizens, beacons of their community and deeply committed to family.
Three more people were wounded. Nearly all the victims were black, including all those who died.
The shooter's hateful writings echoed those of the white supremacists who marched with torches in 2017 in Charlottesville, Virginia, a scene that Biden said inspired his decision to run against President Donald Trump in 2020 and that drove him to join what he calls the "battle for the soul of America".
In Buffalo, Payton Gendron, 18, was arrested at the supermarket and charged with murder. He has pleaded not guilty. His lawyers declined to comment Tuesday.
Before the shooting, Gendron is reported to have posted online a screed overflowing with racism and antisemitism. The writer of the document described himself as a supporter of Dylann Roof, who killed nine black parishioners at a church in Charleston, South Carolina, in 2015, and Brenton Tarrant, who targeted mosques in New Zealand in 2019.
Investigators are looking at Gendron's connection to what's known as the "great replacement theory".
"I condemn those who spread the lie for power, political gain and for-profit," Biden said, stopping short of naming those he believes responsible for perpetuating it.
The claims are often interwoven with antisemitism, with Jews identified as the culprits. During the 2017 "Unite the Right" march in Charlottesville, the white supremacists chanted "Jews will not replace us".
"These actions we've seen, these hate-filled attacks, represent the views of a hateful minority," Biden said.
"We have to refuse to live in a country where Black people going about weekly grocery shopping can be gunned down by weapons of war deployed in a racist cause," he declared. "We have to refuse to live in a country where fear and lies are packaged for power and for profit."
In the years since Charlottesville, replacement theory has moved from the online fringe to mainstream right-wing politics. A third of US adults believe there is "a group of people in this country who are trying to replace native-born Americans with immigrants who agree with their political views", according to a poll conducted in December by the Associated Press-NORC Center for Public Affairs Research.
Tucker Carlson, the Fox News host, is one prominent TV person who accuses Democrats of orchestrating mass migration to consolidate their power.
"The country is being stolen from American citizens," he said last year. He repeated that theme a month later, saying that "this policy is called the great replacement, the replacement of legacy Americans with more obedient people from faraway countries".
Carlson's show routinely receives the highest ratings in cable news, and he responded to the furore by accusing liberals of trying to silence their opponents.
"So because a mentally ill teenager murdered strangers, you cannot be allowed to express your political beliefs out loud," he said.
His commentary reflects how this conspiratorial view of immigration has spread through the Republican Party ahead of this year's midterm elections, which will determine control of Congress.
Facebook advertisements posted last year by the campaign committee of Elise Stefanik, said Democrats want a "PERMANENT ELECTION INSURRECTION" by granting amnesty to illegal immigrants. The plan would "overthrow our current electorate and create a permanent liberal majority in Washington".
Alex DeGrasse, a senior adviser to Stefanik's campaign, said Monday she "has never advocated for any racist position or made a racist statement". He criticised "sickening and false reporting" about her advertisements.
Stefanik is the third-ranking leader of the House Republican caucus, replacing Liz Cheney, who angered the party with her denunciations of Trump after the attack on the Capitol.
Cheney, in a tweet, said the caucus' leadership "has enabled white nationalism, white supremacy, and anti-Semitism. History has taught us that what begins with words ends in far worse".