At 14.40 GMT a single attacker drove a car over Westminster Bridge, near the Houses of Parliament in central London, killing at least two pedestrians and injuring many more.
The car then crashed into railings outside the Houses of Parliament.
The attacker, armed with a knife, ran to Parliament where he was confronted by the police. One officer - who was not armed - was stabbed and killed.
The attacker was shot dead by armed officers.
What was the scene like?
Witnesses have described pandemonium and panic.
One, Richard Tice, said he was coming out of Westminster tube station at about 14:45 and was ushered by police onto Westminster Bridge.
He saw people lying on the bridge being tended to. He was told that a car had mounted the pavement and driven the whole way, from south to north, across the bridge, knocking people over.
"I counted eight people the length of the bridge, from south to north - at least eight."
Who were the victims?
So far, only the police officer has been named. He was PC Keith Palmer, 48, of the Parliamentary and Diplomatic Protection Command. He had 15 years' service and was a husband and a father.
The injured included three police officers who were walking across the bridge on their way back from a commendation ceremony. Two are described as being in a serious condition.
Police said a "range of nationalities" were among the injured.
A group of French schoolchildren were on the bridge and three were injured in the incident.
Four university students from Edge Hill University, in Lancashire, were also hurt.
Who was the attacker?
The prime minister said there was a "single attacker".
He has not yet been named. Police say they think they know who he is, and are "working to look at associates".
Acting deputy commissioner Mark Rowley, the Met's top anti-terror officer said the working assumption was that the attacker was "inspired by international terrorism", but would not comment on his nationality or any other details.
He said police were focusing on the suspect's "motivation, preparation and associates".
What security has been put in place?
Parliament was suspended and politicians, journalists and visitors to the buildings were locked in for about five hours.
Hundreds of people were evacuated from Parliament to Westminster Abbey for safety.
Police and the London mayor said there would be more unarmed and armed police officers on the streets in following days.
The UK's threat level has been set at "severe" - meaning an attack is highly likely - for some time and this would not change, the prime minister said.
Theresa May's London Attack Speech
Tomorrow morning, Parliament will meet as normal. We will come together as normal.
And Londoners - and others from around the world who have come here to visit this great City - will get up and go about their day as normal.
They will board their trains, they will leave their hotels, they will walk these streets, they will live their lives.
And we will all move forward together. Never giving in to terror. And never allowing the voices of hate and evil to drive us apart.
World leaders show solidarity
Chinese President Xi Jinping has offered his condolences to Queen Elizabeth II for the victims of the attack.
Xi strongly condemned the attack, and extended his deepest condolences to the families of the victims. He said terrorism is the common enemy of society, noting that China firmly opposes to any form of terrorism. Xi also noted that China is willing to strengthen security and anti-terrorism cooperative efforts with the UK and the world.
French President Francois Hollande expressed his "solidarity" with the British people, saying "terrorism concerns us all and France knows how the British people are suffering today".
German Chancellor Angela Merkel, whose country saw a lorry attack in December that killed 12 people in Berlin, said her thoughts were "with our British friends and all of the people of London".
"I want to say for Germany and its citizens: we stand firmly and resolutely by Great Britain's side in the fight against all forms of terrorism," she added.
US President Donald Trump spoke by phone to British Prime Minister Theresa May to offer his condolences and to praise the effective response of UK security services.
Mr Trump pledged the "full co-operation and support" of the US government in bringing those responsible for the attack to justice, the White House said in a statement.
Canadian Prime Minister Justin Trudeau said in a statement that it was an "attack on democracies around the world" and Canadians stood "united with the British people in the fight against terrorism".
Australian Prime Minister Malcolm Turnbull said it was an "attack on parliaments, freedom and democracy everywhere" and offered his support and solidarity to the British government.
Russian foreign ministry spokeswoman Maria Zakharova expressed sympathy for the injured and offered condolences to the relatives of those who had died, adding: "We don't split terrorism into categories; we consider it as absolute evil. At this moment, as always, our hearts are together with the British people".
Saying his thoughts were "with London tonight", European Commission President Jean-Claude Juncker recalled it was the first anniversary of the Brussels attacks.
"At this emotional time, we at the European Commission can only send that sympathy back twofold." he said in a statement.
Passer-by 'stops to take a SELFIE'
"Unbelievable! Some people disgusting! Please track this sick individual down & shame him publicly at the very least!"
"What is wrong with some people man. No brains at all."
"Touched by the bravery of those that ran towards victims to offer help and support. Disgusted by those taking selfies."