The man who carried out the stab attack at London Bridge on Friday, named by police as Usman Khan, had previously been jailed for terrorism offences.
Khan, 28, was wearing a GPS police tag and was out of prison on licence when he launched his attack, in which a man and a woman were killed and three others were injured.
Khan was shot dead by officers after members of the public restrained him.
The Queen said she was "saddened" by the attack.
She thanked the emergency services "as well as the brave individuals who put their own lives at risk to selflessly help and protect others".
Police declared the attack a terrorist incident.
Khan was known to the authorities, having been convicted for terrorism offences in 2012. He was released from prison on licence in December 2018, Met Police Assistant Commissioner Neil Basu said.
As part of his release conditions, Khan was obliged to take part in the government's desistance and disengagement programme - the purpose of which is the rehabilitation of people who have been involved in terrorism.
The Parole Board said it had no involvement in the 28-year-old's release, saying he "appears to have been released automatically on licence (as required by law)".
After leaving prison he had moved into a Stafford property on the "approved premises" list.
The attack began at 13:58 GMT on Friday at Fishmongers' Hall, at the north end of London Bridge, at a Cambridge University conference on prisoner rehabilitation.
The Learning Together scheme, which featured in the BBC's Law in Action programme earlier this year, allows university students and prisoners to study alongside each other.
Khan had been one of dozens of people at the event.
Mr Basu said the attack is understood to have started inside the building, before continuing onto London Bridge itself, where Khan was shot by armed officers.
Police are carrying out a search, believed to be linked to the attack, at flats in Stafford, close to the town centre.
Staffordshire Police's Deputy Ch Con, Nick Baker, said it was "vitally important everyone remains alert but not alarmed".
Mr Basu added police were not actively seeking anyone else in relation to the attack, although they were making "fast time enquiries" to make sure there was no outstanding threat to the public.
The Met Police is urging anyone with information - particularly anyone who was at Fishmongers' Hall - to contact them.
Shock and disbelief at search site
Ben Perrin, BBC News Online Staffordshire
There is a general feeling of shock and disbelief here in Stafford, where a top floor flat is being searched.
Blue screens and forensic tents are outside the front of the semi-detached property within a 50m police cordon.
I've seen evidence bags being taken out of the house and the garden also appears to be part of the search.
The property is believed to be privately-owned and used, in part, as a halfway house. Local residents have told me it has a high turnover of tenants and Khan had only been living there for about six months.
A man and a woman were killed during the attack. Three others - a man and two women - were also injured and remain in hospital.
NHS chief Simon Stevens said, on Friday, that one person was in a critical but stable condition, another was stable and the third had less serious injuries.
None of those killed or injured has so far been named and officers were still working to identify those who died, Met Commissioner Cressida Dick said on Friday.
Police believe the attacker had acted alone, the commissioner added on Saturday.
The actions of the public have been widely praised, including by Prime Minister Boris Johnson, Labour leader Jeremy Corbyn and Ms Dick, who said they had shown "extreme courage".
Videos posted on social media appeared to show passers-by holding Khan down, while a man in a suit could be seen running from him, having apparently retrieved a large knife.
One witness described how a man at the event at Fishmongers' Hall grabbed a narwhal tusk - a long white horn that protrudes from the whale - that was on the wall, and went outside to confront the attacker.
Another person let off a fire extinguisher in the face of the attacker to try to keep him at bay.
One of those who rushed to help during the attack was a convicted murderer who was attending the prisoner rehabilitation event on day release, the Times reported.
James Ford, 42, was jailed for life with a minimum of 15 years in 2004 for the murder of Amanda Champion, a 21-year-old woman with learning difficulties.
Mr Basu said Khan was wearing what was believed to be a hoax explosive device.
The prime minister put election campaigning on hold on Friday to hold a meeting of the government's emergency Cobra committee.
Mr Johnson visited the scene at London Bridge on Saturday with Met Commissioner Ms Dick and Home Secretary Priti Patel.
He praised the "incredible" response by members of the emergency services and the "sheer bravery" of members of the public who intervened.
Mr Johnson said his "immediate takeaway" from the attack was to "toughen up sentences" for serious and violent offences.
"When people are sentenced to a certain number of years in prison, they should serve every year of that sentence," he added.
London Mayor Sadiq Khan he was "in awe of the bravery, the courageousness of ordinary Londoners" who stopped the attacker.
He told BBC Breakfast there would be an increased presence of armed and unarmed police officers in London over the weekend, adding they were there to "reassure us - not because there is an additional or heightened threat".
The London mayor also told BBC Radio 4's Today programme the UK had to make sure the "right lessons" were learned from the attack.
"You can't disaggregate terrorism and security from cuts made to resources of the police, of probation - the tools that judges have," he said.
But security minister Brandon Lewis told the programme funding for counter-terrorism policing had consistently increased since 2015.
"We will make sure that the police has got the resource that it needs," he added.
Political parties cancelled some events on Saturday, which had been planned ahead of the general election on 12 December.
Flags on UK government buildings will fly at half-mast on Saturday as a mark of respect to all those affected by the attack.
The Queen said in a statement: "Prince Philip and I have been saddened to hear of the terror attacks at London Bridge.
"We send our thoughts, prayers and deepest sympathies to all those who have lost loved ones and who have been affected by yesterday's terrible violence."
London Bridge was the scene of another attack, on 3 June 2017, in which eight people were killed and many more injured.
The Dean of Southwark Cathedral, the Very Revd Andrew Nunn, said Friday's events had brought back memories of the 2017 attack.
"It's only two-and-a-half years since the June attack and that's not long for healing, and actually it feels as though wounds have been reopened," he said.
"Where people felt they had come to terms with what had happened in their community, now I think they're wondering whether they really had - so a lot of work for us to do," he added.
This latest attack comes after the UK's terrorism threat level was downgraded on 4 November from "severe" to "substantial", meaning that attacks were thought to be "likely" rather than "highly likely".
The terror threat level is reviewed every six months by the Joint Terrorism Analysis Centre, which makes recommendations independent of government.
Some of the early debate about the London Bridge attack has focused on the sentence imposed on Usman Khan.
The sentencing judge thought Khan should be freed from prison only when it was safe to do so, as part "indeterminate penalty" scheme (IPP).
But the Court Of Appeal replaced Khan's IPP with an extended sentence, which required his release at the halfway point of his 16-year custodial term.
The IPP regime was scrapped in 2012 - a decision that was widely supported at the time.
Since Khan's conviction, legislation has been put in place for the Parole Board to determine when offenders on extended sentences should be let out.
The attack also raises questions about the extent to which people convicted of terrorism offences can be de-radicalised.
Khan was one of 51 inmates with terror links let out of jail in the 12 months to the end of March 2019, so it's inevitable that the role of those monitoring him will now be scrutinised.
Did the authorities pick up any warning signs about Khan? Was he meeting people he shouldn't have done or plotting the attack? If no signs were detected, why not? And if the authorities did spot concerns, what did they do?
Friday's horrific attack was the second fatal stabbing at an offender rehabilitation event this month, after Hakim Sillah died at a knife awareness course in Hillingdon, west London.
These events will likely fuel concerns about safety at such venues and whether checks need to be strengthened.
Did you witness what happened? Please share your experiences by emailing email@example.com.
Please include a contact number if you are willing to speak to a BBC journalist. You can also contact us in the following ways: