The attack started with an auto bomb that detonated close to the compound’s gates, causing an explosion that shook buildings across the diplomatic district in the city center, shattering nearby windows.
Police spokesman Basir Mujahid said of the wounded, nine were civilians and one a policeman.
Gunfire could be heard following the explosion.
The Spanish embassy is located in Sherpur, which is in central Kabul.
Spanish Prime Minister Mariano Rajoy called the assaults a terrorist attack, telling reporters that it appeared to have targeted guesthouses near the Embassy.
The Spanish government says all details of the attack are under investigation. He couldn’t immediately confirm which delegation managed them.
The Taliban, the Islamist militant group that controlled much of the country before a 2001 U.S.-led invasion, claimed responsibility for “suicide attacks… on a guesthouse of invaders in the Sherpoor area of Kabul in the evening”.
In Washington, White House spokesman Josh Earnest said US personnel in Kabul assisted the Afghans in responding to the explosion. The attacks were aimed at the government and foreign bodies.
It is unclear whether the Taliban planned the attacks deliberately to retaliate against Afghan President Ashraf Ghani’s recent visit to Pakistan, which occurred during the Kandahar attacks, to strengthen ties with the Pakistanis and discuss ways to reduce the Taliban’s threat in Afghanistan. The meetings ended on Wednesday, with an agreement between both countries to work toward restarting the process.
Separately, at least 848 Afghan civilians were killed or wounded following a Taliban attack on the northern city of Kunduz in September, according to a United Nations report that detailed the grim conditions endured by residents during two weeks of fighting.
The Islamist movement has been racked by internal power struggles of its own with rival factions battling for supremacy since it confirmed in July that its founder, Mullah Mohammad Omar, had died more than two years previously.