Afghan security forces have killed four militants who attacked a UN compound in the western city of Herat, officials say.
A fifth attacker blew himself up at the gates, before the others, wearing suicide vests got inside, triggering a gun battle with police.
A UN guard and a policeman were lightly hurt.
The assault is reminiscent of an attack on a USAID office in July in Kunduz province, which left four people dead.
In the latest incident, the four attackers, dressed in burkas worn by women, ambushed the compound just before midday.
Police and security forces surrounded the base, which houses a number of UN offices, and fought a 15-minute gun battle with the militants.
All the attackers were killed, a spokesman for the provincial governor said.
A Taliban spokesman said the group was behind the attack, AFP news agency reported.
The BBC's Quentin Sommerville in Kabul says Herat is one of the safer places in Afghanistan, although insurgent attacks in the area have increased lately.
It was the largest attack against a UN target in Afghanistan since last year.
In October 2009, 12 people, including six UN workers were killed, when insurgents raided a guesthouse in the capital, Kabul.