Former President Obama on Thursday voiced sympathy for the victims of a terror attack in London.

"My heart goes out to the victims and their families in London," he tweeted. "No act of terror can shake the strength and resilience of our British ally."

Four people reportedly died, including a police officer and his alleged assailant, and dozens were injured Wednesday during an incident near the Houses of Parliament.

The suspected attacker drove a car into a crowd of pedestrians, officials said.

ADVERTISEMENT

Mark Rowley, Britain’s top counterterrorism law enforcement official, said the driver then tried to enter the Parliament complex and fatally stabbed a police officer.

The assailant — whom police officials believe they identified but have not yet publicly named — was shot and killed by law enforcement officers.

London Metropolitan Police Service Commander BJ Harrison said during a news conference that a “full counterterrorism investigation” is underway.

Reports emerged Thursday that at least seven people at six different addresses in Birmingham and London were arrested in anti-terror raids.

The Islamic State in Iraq and Syria claimed Thursday that the attacker was “a soldier” acting on its behalf.

“[The attacker] carried out the operation in response to calls for targeting citizens of the coalition,” the terror group said via its Aamaq news agency.