The Islamic State (IS) militant group has freed around 350 members of the Yazidi religious community in northern Iraq.
The group of mainly elderly Yazidis crossed out of IS-controlled territory and were received by Kurdish officials near the city of Kirkuk.
It is not yet clear why militants released them.
IS attacked the Yazidi minority community in Iraq last year, killing and abducting thousands of people.
Almost all of those released on Saturday were elderly or unwell, said Reuters.
The group, including several sick infants, were taken directly by Kurdish Peshmerga forces to a health centre for treatment.
Khodr Domli, a leading Yazidi rights activist, was at the centre. "Some are wounded, some have disabilities and many are suffering from mental and psychological problems," he told the AFP news agency.
"These men and women had been held in Mosul," he added.
The BBC's Rami Ruhayem in Baghdad said that many of the captives had feared that they would be executed when the militants ordered them onto buses.
Instead, they were taken to a crossing point between IS-controlled Hawija and the Kurdish city of Kirkuk.
One of them, an elderly Yazidi man in a wheelchair, told AFP that they had spent months in captivity.
"It was so hard, not only because of the lack of food but also because I spent so much time worrying," he said.
The circumstances surrounding the group's release are still unclear.
Kurdish Peshmerga forces drove back Islamic State militants in north-western Iraq last month, breaking a long siege of Sinjar mountain where thousands of Yazidis had been stranded for months.
But many Yazidi villages remain under IS control. Yazidi women and girls have been forced to marry or been sold into slavery by IS.
The Yazidi community estimate that around 3,000 women and children are still being held captive.