An hours-long gunbattle with insurgents in central Kabul ended early Wednesday with the four attackers killed, a government minister said, reporting no civilian or military casualties.
"Four attackers who had one RPG launcher, three AK-47s and one grenade launcher were killed in Wazir Akbar Khan," deputy interior minister Mohammad Ayoub Salangi said on Twitter.
The Taliban claimed responsibility for the overnight attack in the diplomatic district of Wazir Akbar Khan, as the insurgents press their annual spring offensive.
Sporadic blasts were heard hours after the assault began late Tuesday in the upmarket neighbourhood of Wazir Akbar Khan, home to several foreign embassies and a prime target for attacks.
"We have surrounded the area and cornered them," Kabul police spokesman Ebadullah Karimi told AFP earlier.
"The attackers wanted to get into Heetal Hotel but failed. They have now taken position among the trees behind the hotel and are firing at security forces."
The manager of the Heetal Hotel, owned by the family of Foreign Minister Salahuddin Rabbani and known for being popular with foreigners, said all the guests were in safe rooms and no one was hurt.
"Heetal is very well fortified. After one or two initial explosions, our guards started firing on attackers who were unable to get inside," manager Beizhan told AFP by telephone from inside the guesthouse.
The Heetal was damaged in 2009 when a suicide bomber blew himself up outside the gate, killing eight people and wounding another 40.
Tuesday's attack began around 11:00 pm (1830 GMT). An AFP reporter near the scene heard the loud crackle of gunfire and more than a dozen explosions from the area.
The Taliban, waging a 13-year war against the US-backed Afghan government, earlier Tuesday killed 26 Afghan police in multiple attacks in the volatile south.
Heavy civilian toll
The militants have launched a series of attacks in the capital and around the country as NATO forces have pulled back from the frontlines.
A blast triggered by a Taliban car bomber ripped through the parking lot of the justice ministry in Kabul on May 19, killing four people and wounding dozens of others.
Also this month 14 people -- mostly foreigners -- were killed in a Taliban attack on a guesthouse in the capital that trapped dozens attending a concert.
Official efforts to bring the Taliban to the negotiating table have so far borne little fruit.
The surge in attacks has taken a heavy toll on civilians, according to the United Nations Assistance Mission to Afghanistan. In the first four months of 2015, civilian casualties jumped 16 percent from the same period last year, it said.
The Afghan government has drawn public criticism for failing to end insurgent attacks, which critics blame on political infighting and a lengthy delay in finalising a cabinet.
President Ashraf Ghani last Thursday nominated Mohammad Masoom Stanekzai, a top official in the government body overseeing the country's peace process, for the crucial position of defence minister.
The post had been left vacant for months due to disagreements between Ghani and his chief executive officer and former presidential election rival, Abdullah Abdullah.
Public criticism over the failure to appoint a defence minister has been especially fierce.
Afghan forces are now solely responsible for security after NATO's combat mission formally ended in December, with a small follow-up force staying on to train and support local personnel.
Earlier this month NATO formally announced plans to retain a small military presence in Afghanistan after 2016 to help strengthen local security forces.