The Spanish embassy in Kabul has come under attack, the Spanish foreign ministry says.
The Taliban say their fighters are inside a "foreign guesthouse" in the Afghan capital after detonating a suicide car bomb outside.
It is the latest in a series of audacious raids by Taliban fighters on high-profile targets in Afghanistan.
Several casualties have been brought in to a nearby hospital, and eyewitnesses say a gun battle is still under way.
It follows a Taliban attack on Kandahar airport on Tuesday evening in which at least 50 people were killed.
Afghan security officials say that seven insurgents are involved in the attack.
Both Afghan and Spanish security forces are reportedly at the scene.
Spanish President Mariano Rajoy has been informed, the Europa Press agency reported.
Eyewitnesses reported hearing a loud explosion followed by heavy gunfire on Friday evening.
Kabul police chief Abdul Rahman Rahimi told the BBC: " I can only confirm a suicide car bomb in the Sherpur area at this moment".
Freelance journalist Bilal Sarwary reported seeing two Spanish diplomats fleeing the compound shortly after the attack.
He saw one of them repeatedly bang their head on a vehicle in a show of grief.
Afghan police report that the militants had burned several armoured vehicles that they found inside the compound.
The initial explosion left two houses on fire, a police official told the Associated Press.
"It's possible the attackers are hiding. We've blocked all the streets and are searching," he added.