Twelve international United Nations employees who had been held by Yemen's Houthis inside their compound flew out of the Houthi-held capital on Wednesday, the UN said.
The Iran-backed Houthis raided the UN compound in the capital Sanaa last weekend, holding 20 staff including 15 foreigners. Five Yemeni nationals were released on Sunday.
The militants have harassed and detained UN staff and aid workers for years, accusing them of spying, but they have accelerated arrests since the start of the Gaza war.
"Earlier today, 12 UN international staff who were amongst those previously held in the UN compound in Yemen departed Sanaa on a UN Humanitarian Air Service flight," said a statement released by UN Secretary-General Antonio Guterres's spokesperson.
Their destination was not revealed. The three remaining staff are now "free to move or travel", the UN said.
Among those detained was UNICEF's representative in Yemen Peter Hawkins, a UN source and Houthi sources told AFP at the time.
The Houthis, part of Iran's "axis of resistance" against Israel and the United States, have frequently fired on Red Sea shipping and Israeli territory during the two-year Gaza war, claiming solidarity with the Palestinians.
Israel has launched numerous retaliatory strikes, including a major attack in August that killed the Houthis's premier and nearly half of his cabinet.
Houthi leader Abdulmalik al-Houthi accused detained UN employees of having a hand in the attack, without giving evidence. The UN has rejected the claim.
A total of 53 UN workers are still arbitrarily detained by the Houthis, according to the international body.
The militants stormed UN offices in Sanaa on August 31, detaining more than 11 employees, it said.
A senior Houthi official told AFP the UN staff were suspected of spying for the United States and Israel.
In mid-September, the UN humanitarian coordinator in Yemen was transferred from Sanaa to Aden, the interim capital of the legitimate government.