The Queen has sent a message to US President Biden marking 20 years since the 11 September attacks, saying her thoughts and prayers are with the victims, survivors and their families.
In her message, she also paid tribute to the resilience of the communities who joined together to rebuild.
UK Prime Minister Boris Johnson said the terrorists had failed to "shake our belief in freedom and democracy".
After sunset, 67 candles were lit to remember the British victims.
Commemorations have been taking place at a memorial garden in Grosvenor Square, London, where a private service of remembrance was held earlier, organised by a support group for victims' families.
Other events have been held around the world to remember the 2,977 people killed.
The attacks, which were planned by al-Qaeda from Afghanistan, saw four US passenger jets seized by suicide attackers - two of which were flown into the Twin Towers of the World Trade Center in New York.
Another plane crashed into the Pentagon, just outside US capital Washington DC, and a fourth plane crashed in a field in Pennsylvania after passengers fought back.
In her message to President Biden, the Queen said: "As we mark the 20th anniversary of the terrible attacks on September 11 2001, my thoughts and prayers, and those of my family and the entire nation, remain with the victims, survivors and families affected, as well as the first responders and rescue workers called to duty.
"My visit to the site of the World Trade Center in 2010 is held fast in my memory.
"It reminds me that as we honour those from many nations, faiths and backgrounds who lost their lives, we also pay tribute to the resilience and determination of the communities who joined together to rebuild."
And in a defiant message to mark the anniversary, the prime minister said while the terror threat remained, people refused "to live in permanent fear".
"That we are coming together today - in sorrow but also in faith and resolve - demonstrates the failure of terrorism."
Events have also been taking place at Windsor Castle, where a special changing of the guard ceremony took place, during which the US national anthem was played. It was an echo of the playing of the Star Spangled Banner at Buckingham Palace 20 years ago on the day after the atrocity, as a gesture of solidarity.
There was a minute's silence after the Band of the Welsh Guards performed the anthem, watched by hundreds who had gathered at the castle.
Acting US ambassador Philip T Reeker said the events were a reminder that the US had "no closer ally and no closer friend in good times and in bad times" than the UK.
He said: "This has shown the special relationship remains so crucial to all of us."
Mr Reeker was among those attending another event at Queen Elizabeth Olympic Park in London, organised by education charity Since 9/11 for survivors of the attacks.
During the commemoration, the message from the PM was played, in which he said recent events in Afghanistan had only strengthened people's belief in freedom and democracy.
"Twenty years ago, September 11 2001 became, in President Roosevelt's words after Pearl Harbor, a 'date which will live in infamy'," Mr Johnson said.
"On a crystal clear morning, terrorists attacked the United States with the simple goal of killing or maiming as many human beings as possible, and by inflicting such bloodshed in the world's greatest democracy, they tried to destroy the faith of free peoples everywhere in the open societies which terrorists despise and which we cherish."
Mr Johnson said that "precisely because of the openness and tolerance of the United States", people of almost every nationality and religion were among those murdered that day.
"But while the terrorists imposed their burden of grief and suffering, and while the threat persists today, we can now say with the perspective of 20 years that they failed to shake our belief in freedom and democracy; they failed to drive our nations apart, or cause us to abandon our values, or to live in permanent fear."
Tony Blair, who was prime minister at the time, also recorded a message for the event, saying the thinking of the 9/11 terrorists was "filled with hatred, an ideology at violent odds with a world seeking to flourish across boundaries of faith and culture".
It is as "flawed and irrational" today as it was 20 years ago, he said.
A split-second decision saved my life
On 11 September, 2001, Andrew Cullen - originally from Motherwell in North Lanarkshire - arrived at work on the 89th floor of the South Tower. Soon afterwards, he heard an explosion in the North Tower.
"Myself and three colleagues made the decision to get out of the building, so we headed towards the stairwell and began descending from the 89th floor down to the Sky Lobby at the 44th floor," he said.
"It was at that point that the port authority instructed us to go back to our offices, so they sort of shuffled us into one of the freight elevators.
"At that point the button for 78 was lit but we decided we wanted to go down, so I was the one who pounded the lobby button just a few moments before the second plane hit the tower above us."
Labour leader Sir Keir Starmer said the anniversary was about remembering and honouring those who were killed and showing "support to our American friends as they mark this difficult time in their history".
He said the tragedy was "still so raw", with the consequences of the attacks "still being felt to this day".
"But as we mark this anniversary, I'm convinced our resolve has never been stronger," he said. "We will continue to fight terror and violence, by promoting our values of justice and peace."
London Mayor Sadiq Khan said the lives of innocent people, including the 67 Britons, would be remembered, adding: "Our values of freedom, tolerance and respect will always, always prevail. Hate will never win."
The Archbishop of Canterbury said 20 years on it was still hard to articulate the sense of "shock and horror" felt around the world after the attacks - including "the devastating loss experienced by so many people, and the fear and uncertainty that terrible day brought".
Justin Welby added: "9/11 was a sharp reminder to us of the fragility of the privilege many of us have of living free of the threat of violence, while many in our world continue to wake to war or the fear of war."
He urged his followers to follow the example of the first responders to the Twin Towers and be willing "to make sacrifices for the wellbeing of others".
- RADIO 1'S LIVE LOUNGE IS BACK: Listen to a stunning performance by Camila Cabello
- GETTING MARATHON READY: How long does it take to train for a marathon?