The United Nations has said it is temporarily relocating 600 of its "non-essential" foreign staff in Afghanistan following last week's deadly Taliban attack.

The attack by suicide bombers at a hostel in Kabul killed five UN workers and three Afghans.

The relocation of staff to more secure areas in and outside of Afghanistan would allow the UN time to find safer permanent housing, spokesman Aleem Siddique said.

He added that the move, which is likely to take three or four weeks, would not affect key UN work such as aid delivery, as this was done by local Afghan staff.

The UN said earlier in a statement: "Every effort will be made to minimise disruption to our activities while these additional security steps are being taken."

The body currently has 1,100 international staff in the country, with the majority living in Kabul, spread out among more than 90 guesthouses.

Siddique emphasised that the move was not tantamount to a withdrawal. "We've been here for over half a century and we're not about to go any time soon," he said.

In the October 28 attack, gunmen wearing suicide vests and armed with grenades and machine guns stormed the hostel.

The Taliban claimed responsibility for the attack and said they intentionally targeted UN employees working on the recent presidential election.