By Hashim Safi
A policeman is dead after multiple blasts and gunfire rocked the area around the Spanish embassy in Kabul in the early hours of Saturday, officials said.
The attack comes just hours after President Ashraf Ghani voiced optimism that a peace process with the Taliban would resume within weeks.
The dead man has been named as 48-year-old Spanish policeman Isidro Gabino Sanmartin Hernandez.
Security men near the embassy ducked from gunshots as they hauled away a limp body and two wounded men - one bleeding from the head, the other a policeman with a gunshot wound to his leg - through the dark to a waiting ambulance.
Nearly six hours after the brazen raid began, a series of fresh blasts and a volley of gunshots ripped through the area as security forces battled with the insurgents.
The embassy was earlier reported to be the target of the attack, but Spain's Prime Minister Mariano Rajoy clarified that the assault was nearby and not on the compound.
"It was an attack against some guesthouses very near the embassy," Rajoy said, confirming that all embassy staff had been evacuated.
The Emergency hospital in Kabul tweeted that seven wounded Afghans had been received for treatment.
The Taliban claimed responsibility for the attack, saying the target was a foreign guest house.
Afghan special forces had cordoned off the area in Sherpur district in central Kabul, where a huge car bomb struck during rush hour on Friday evening, followed by sporadic bursts of gunfire.
Ambulances and fire brigades with wailing sirens were seen rushing to the scene.
Friday's assault follows a deadly Taliban siege of Kandahar airport this week.
At least 50 people, including women and children, died in the 27-hour Taliban siege of Kandahar airport, the largest military installation in southern Afghanistan.
Eleven suicide attackers on Tuesday breached the high-security complex, which also houses a joint NATO-Afghan base, taking families hostage and triggering pitched firefights with soldiers.