This story has been updated to reflect the latest number of fatalities from London Metropolitan Police.

London (CNN) Four people were killed and scores injured when an attacker plowed a car through crowds in central London before attempting to storm the Houses of Parliament in what police believe was an act of Islamist-inspired terrorism.

Police indicated they knew the identity of the assailant, who fatally stabbed unarmed police officer Keith Palmer, a 15-year-veteran, on the grounds of Parliament after ramming a car onto the crowded sidewalks nearby. Armed officers shot the attacker dead.

It was the first mass-casualty terrorist attack in Britain since 2005 when 52 people and four attackers died in the July 7 bomb attacks on the London public transportation system. The use of a vehicle as a weapon of terror echoed the methods used in the past year by attackers in Nice and Berlin.

The London assault, which came on the one-year anniversary of the ISIS bomb attacks in Brussels, brought carnage to Westminster, the heart of political life in Britain.

Prime Minister Theresa May described the attack as "sick and depraved." She said attempts to defeat through violence the values Parliament represents would be "doomed to failure."

"The location of this attack was no accident. The terrorist chose to strike at the heart of our capital city, where people of all nationalities, religions and cultures come together to celebrate the values of liberty, democracy and freedom of speech," she said.

JUST WATCHED The moment the UK Parliament stopped Replay More Videos ... MUST WATCH The moment the UK Parliament stopped 00:32

Parliament was placed on lockdown for several hours and lawmakers were forced to remain in the main debating chamber of the House of Commons as officers rushed to the scene outside.

Pictures showed scenes of carnage in the aftermath of the attack, which happened as Parliament was in session. One member of the British government gave mouth-to-mouth resuscitation to the officer who died from stab wounds.

'Islamist-related'

Mark Rowley, Britain's most senior counterterror police officer, told reporters late Wednesday that authorities believe they know the attacker's identity but are not releasing it, and are operating on the assumption the incident was "Islamist-related terrorism."

"This is a day that we had planned for -- that we all hoped would never happen -- but sadly it is now a reality," said Rowley, acting deputy commissioner of the Metropolitan Police.

He said Palmer, 48, was a father and a husband.

Rowley said 40 people were hurt.

Incident began near Westminster Bridge

The area around Westminster was teeming with people when the attack began at about 2:40 p.m. Witnesses said the attacker drove his car over Westminster Bridge and into the crowds. The vehicle hit a large number of people, including three police officers.

"The car then crashed near to Parliament and at least one man -- armed with a knife -- continued the attack, trying to enter Parliament," said Rowley. One of those who died was a woman, he said.

Photos: Deadly attack outside UK Parliament A car is seen crashed into a fence outside the Parliament building in London on Wednesday, March 22. Police have launched a "full counter-terrorism investigation" after an attacker rammed a car into crowds of people and stabbed a police officer on Parliament grounds. Hide Caption 1 of 15 Photos: Deadly attack outside UK Parliament An armed police officer stands over the attacker, identified as Khalid Masood, outside Parliament. "It appeared that a car was coming towards the House of Commons mowing down pedestrians on the way," Member of Parliament Gerald Howarth told CNN. "The driver then got access to the parliamentary estate, stabbed a police officer and was shot." Hide Caption 2 of 15 Photos: Deadly attack outside UK Parliament Masood is treated by emergency services as police look on at the scene outside the Houses of Parliament. The Metropolitan Police say he was born in Kent, but is believed to have been living in the West Midlands recently. Police say Masood was also known by a number of aliases. "Masood was not the subject of any current investigations and there was no prior intelligence about his intent to mount a terrorist attack," Met Police said in a statement. Hide Caption 3 of 15 Photos: Deadly attack outside UK Parliament Member of Parliament Tobias Ellwood, in the glasses, tends to one of the injured people amid the chaos. The man the politician was trying to save was a police officer who died, a witness on the scene told CNN. Authorities identified the deceased officer as Keith Palmer, 48. Hide Caption 4 of 15 Photos: Deadly attack outside UK Parliament Emergency workers attend to injured people at the scene. Hide Caption 5 of 15 Photos: Deadly attack outside UK Parliament Medics treat a victim on Westminster Bridge. Hide Caption 6 of 15 Photos: Deadly attack outside UK Parliament People leave the Parliament building after the incident. Lawmakers were forced to remain in the main debating chamber of the House of Commons as police responded to the incident outside. Hide Caption 7 of 15 Photos: Deadly attack outside UK Parliament A person is treated at the scene. Hide Caption 8 of 15 Photos: Deadly attack outside UK Parliament Medical aid is provided outside Parliament. Hide Caption 9 of 15 Photos: Deadly attack outside UK Parliament Tourists were trapped for a time in cars on the London Eye Ferris wheel, which was stopped in the immediate aftermath of the attack. Hide Caption 10 of 15 Photos: Deadly attack outside UK Parliament A police officer stands guard near Westminster Bridge and the Houses of Parliament. Hide Caption 11 of 15 Photos: Deadly attack outside UK Parliament A person receives medical treatment at the scene. Hide Caption 12 of 15 Photos: Deadly attack outside UK Parliament At right, the car of British Prime Minister Theresa May is driven away from Parliament. Hide Caption 13 of 15 Photos: Deadly attack outside UK Parliament An air ambulance arrives at the scene. Hide Caption 14 of 15 Photos: Deadly attack outside UK Parliament Armed police enter the Houses of Parliament. Hide Caption 15 of 15

Proceedings in the House of Commons were suspended, with dozens of MPs locked inside.

Police put the Westminster area on lockdown, securing roads, Parliament buildings and the Westminster underground station. The zone was soon expanded to a larger part of central London, including the London Eye Ferris wheel, which was halted for hours with people still on it. They have since been let off.

JUST WATCHED People trapped on London Eye following attack Replay More Videos ... MUST WATCH People trapped on London Eye following attack 01:17

The London Ambulance Service treated at least 10 patients on Westminster Bridge.

In the chaos, a woman was pulled from the River Thames alive, but with serious injuries.

London Mayor Sadiq Khan said: "My heart goes out to those who have lost loved ones and to everyone who has been affected," he said, paying tribute to the emergency services.

He announced the deployment of additional armed officers on the streets of the British capital. "We stand together in the face of those who would seek to harm us and destroy our way of life," he added. "Londoners will never be cowed by terrorism."

Police appealed for anyone with photos or video of the incident to contact them.

Police close off the area near the Houses of Parliament in London.

The Prime Minister called a meeting of COBRA, the UK's emergency Cabinet committee.

US President Donald Trump spoke with May on the phone after learning of the attack, White House spokesman Sean Spicer said.

Mark Toner, acting spokesman for the US State Department, said officials were closely following the situation.

"Our hearts go out to those affected. We stand ready to assist in any way the UK authorities would find helpful," he said.

Eyewitnesses report chaotic scenes

People were photographed running in a panic from the scene, while witnesses told CNN they saw the car plow through a crowd.

Robyn Lyon, 34, from Rugby, said he was walking along Westminster Bridge.

JUST WATCHED Crashed car smokes outside Parliament Replay More Videos ... MUST WATCH Crashed car smokes outside Parliament 00:26

"I saw a car, the crunch of car, hitting the curb. I kind of thought the guy had maybe had a heart attack or something," he said.

"The accelerator suddenly picked up so you had that revving. I expected it to hit the bridge wall and then stop, and then turn back carry up the pavement. It hit several people. I jumped out the way into a road.

"I stood in shock and saw carnage around me and the car carrying on up the bridge."

Another witness, Radek Sikorski, said he saw one of the victims bleeding heavily from the head and another lying unconscious.

JUST WATCHED Parliament attack witness: 'It was horrendous' Replay More Videos ... MUST WATCH Parliament attack witness: 'It was horrendous' 00:46

Richard Poet, 62, who was visiting London from Brighton and his partner were leaving the Tate Britain gallery when he heard "great crashes."

"I thought it was a wrecking ball. It didn't sound like guns or anything."

Craig Meichan, 20, a student from Ormskirk near Liverpool, was on a field trip with around 15 others and had left Parliament just a moment before. He was shaking as he told CNN his party was separated into three groups.

"It sounded like a car backfiring, police began shouting and they started cordoning off the area," he said, adding that he believed his tutor was still locked inside.

"I'm a bit shaken up, you never expect this to happen to you. When it does it's an indescribable feeling."

Chaos in Parliament

As the incident unfolded outside, the Leader of the House of Commons, David Lidington, told MPs a serious incident had taken place "within the estate." Proceedings were suspended.

Lidington told MPs that it appeared a police officer has been stabbed and that the assailant had been shot.

Emergency services at the scene of the attack.

Conservative MP Damian Collins told CNN that he was walking through an underground tunnel from his office to vote in the chamber with about 30 other MPs when he heard shouting followed by gunshots. Police shouted for the MPs to get down on the ground.

"Clearly, something serious had happened but no one was being told what was going on," he said. "The instant response from the police was incredible -- they seemed on top of the situation straight away."

JUST WATCHED Witnesses describe 'horrendous' Parliament attack Replay More Videos ... MUST WATCH Witnesses describe 'horrendous' Parliament attack 01:23

Chris Doyle, Director of Council for Arab-British Understanding, who was at a restaurant at Parliament at the time, described a moment of sudden panic.

"We were in the terrace restaurant when there was a series of panicked male shouts. Everyone started getting under tables. Under the sofa by me was a small child. Only after several minutes did people get up. It became clear it was the police," he said.

"We still did not know what had happened, if there was a bomb, a gunman a fire. The police directed everyone -- MPs, Lords, cooks, waiters, visitors and schoolchildren -- to the central lobby.

Members of parliament were locked in and asked to keep away from windows.

Hundreds were later evacuated from the Parliament buildings after hours locked inside. Labour MP Barry Sheerman posted an image on Twitter showing lawmakers in the House in the evening with food and drink.

Food & drink consumed in Chamber no end to lock down yet! pic.twitter.com/Vy9xrTEGHr — Barry Sheerman (@BarrySheerman) March 22, 2017

Member of Parliament gives assistance

A member of the government, Foreign Office Minister Tobias Ellwood, was pictured giving assistance to a victim in New Palace Yard, a courtyard within the grounds of Parliament.

A fellow Conservative Party MP, Maria Miller said he had "given mouth-to-mouth resuscitation to one victim," the Press Association said. A witness told CNN that Ellwood was trying to save the police officer, who died.

Eyewitness Hugh Dickinson, a 21-year-old student from High Wycombe, posted a picture of the minister on Twitter, showing the minister bleeding, but saying "he looked to be fine."

Editor's note: This story has been updated to reflect the latest number of fatalities from London Metropolitan Police.