Boris Johnson has urged the country to "work peacefully, lawfully" to defeat racism and discrimination.
Writing in the Voice, the PM said the government could not ignore the anger and "undeniable feeling of injustice" sparked by George Floyd's killing.
But he said the cause risked being "undermined" by a minority who attack police and property during protests.
The UK, he said, had made "huge strides" in tackling racism in recent decades but more had to be done.
More protests are taking place on Tuesday, including in London and Oxford, with the latter focusing on calls for a statue at Oriel College of imperialist Cecil Rhodes to be taken down.
The death of George Floyd, 46, in Minneapolis, in the United States, after a white police officer was filmed kneeling on his neck, triggered an international outcry and sparked days of mass protests in cities across the UK.
While the demonstrations have been largely peaceful, they turned violent in London on Saturday when police officers were confronted with flares, and a statue of wartime leader Winston Churchill was vandalised.
The Mayor of London Sadiq Khan has asked his officials to develop an action plan with community groups - to tackle racism, discrimination and inequality.
Mr Khan said the protests that have followed the death of George Floyd should be a "catalyst for change".
In Bristol, demonstrators pulled down a statue of the slave trader Edward Colston and threw it into the River Avon.
Home Secretary Priti Patel condemned a "lawless minority of protesters" who "regrettably turned to violence", adding: "This hooliganism is utterly indefensible."
In an article for the Voice, the prime minister said Mr Floyd's death had "awakened an anger and a widespread and incontrovertible, undeniable feeling of injustice, a feeling that people from black and minority ethnic groups do face discrimination: in education, in employment, in the application of the criminal law".
"We simply cannot ignore the depth of emotion that has been triggered by that spectacle, of a black man losing his life at the hands of the police," he wrote.
"We who lead and who govern simply can't ignore those feelings because in too many cases, I am afraid, they will be founded on a cold reality."
'More to do'
While he believed the UK was a much less racist society than it was 40 years ago, the PM said he "heard" the Black Lives Matter protesters and accepted much more needed to be done to ensure everyone was treated equally.
"We must also frankly acknowledge that there is so much more to do - in eradicating prejudice, and creating opportunity, and the government I lead is committed to that effort."
Thanking those who abided by social distancing while taking to the streets, the PM warned that further mass demonstrations endangered the UK's efforts to bring the coronavirus epidemic under control.
And he said he could not condone those who "hijacked" peaceful protests by breaking the law or desecrating public monuments, saying they damaged the legitimate cause that people were fighting for.
"We have a democracy in this country. If you want to change the urban landscape, you can stand for election, or vote for someone who will.
"And so I must say clearly that those who attack public property or the police - who injure the police officers who are trying to keep us all safe - those people will face the full force of the law.
"So let's work peacefully, lawfully, to defeat racism and discrimination wherever we find it, and let us continue to work together across all the communities of this country, as we put Britain back on its feet."
Mr Khan also appealed to people not to protest as they may "inadvertently catch the virus" and pass it on to loved ones.
But the London Mayor criticised comments made by Ms Patel and a tweet by Boris Johnson after protests at the weekend.
He told BBC Radio 4's Today programme: "I am quite clear the law has got to be followed. What I am also clear about is I don't lead with words like 'thuggery, recklessness and lawlessness'.
"I lead with empathy and emotional intelligence, recognising the upset and anger people have about their voices not being heard for many years and many decades."
In a statement to Parliament on Monday, the home secretary said 137,500 people had attended more than 200 protests across the UK over the weekend.
She said 135 people had been arrested in total, while 35 police officers had been injured since protests began.
She was challenged by a Labour MP Florence Eshalomi, who asked her whether she recognised the "structural inequality, discrimination and racism" in the UK and called on her to act.
But Ms Patel said she would "not take lectures" from others about racism, and gave examples of the racist abuse she had personally received, including facing racial slurs in the playground and on the streets, and being advised to use her husband's surname in order to advance her career.
How George Floyd's death resonated in the UK
Avon and Somerset Police told the BBC 17 people had been identified in connection with the toppling of Colston's statue. No arrests have yet been made.
Chief Constable Andy Marsh defended the decision taken by commanders on the ground not to intervene when the statue was torn down and dumped in the harbour.
He said arresting suspects could have had "very serious ramifications" for the city of Bristol, including injuries to protesters, police and bystanders.