The Taliban claimed the attack, which began late Saturday, saying five gunmen armed with suicide vests targeted foreigners and Afghan officials.
Interior Ministry spokesman Najib Danish said the last attacker was killed Sunday afternoon, more than 12 hours after the attack began. He says the attack killed six people, including a foreigner and a telecommunications official from the western Farah province who was attending a conference.
Six others, including three security forces, were wounded in the attack on the heavily guarded luxury hotel popular with foreigners and Afghan officials.
Taliban spokesman Zabihullah Mujahid said the insurgents initially planned to attack the hotel Thursday night but postponed the assault because there was a wedding underway and they wanted to avoid civilian casualties.
An Afghan official says a roadside bomb has killed at least 12 civilians in the western Herat province.
Abdul Ahad Walizada, a spokesman for the provincial police chief, says a 13th person was wounded in the explosion early Sunday, which struck a vehicle in the Gulran district.
No one immediately claimed responsibility for the attack, but Walizada blamed Taliban insurgents, who often plant roadside bombs to target Afghan security forces.