At the beginning of April, the Islamic State released more than 200 Yazidis from among the thousands the group is believed to have captured last summer during its expansion from Syria into northern Iraq. At the time, the details of the transfer were murky, with some media reports characterizing the move as a "rare act of goodwill" on the part of the terrorist group.

But VICE News has learned that the release of 217 Yazidis on April 4 was far from a benevolent act. According to United Nations human rights officials, the Yazidis — an ethno-religious minority group whose members are considered infidels by the Islamic State — were sold back to their families as slaves in exchange for cash.

According to UN officials in Iraq, the Islamic State (IS) — which is also known as ISIS, ISIL, and by its Arabic acronym Daesh — regularly requests as much as $30,000 for prisoners.

Faced with a relentless assault from US-led coalition aircraft and Iraqi security forces buttressed by powerful, often Iranian-backed, Shiite militias, IS has by some accounts lost a quarter of the self-proclaimed "caliphate" it captured in Iraq and Syria last year. That pressure, and a pinch on their economic activities, may have played a role in approving the April 4 transfer. But whatever their motives, up until the last moment IS insisted that the Yazidis were slaves and would not be ransomed. Instead, they were sold.

"As ISIL regards those who have not converted as _malak yamiin _[slaves], in ISIL's eyes the money paid was the purchase price," UN human rights chief in Iraq Francesco Motta told VICE News. "All were taken before a so-called Sharia court for the 'bill of sale' to be approved prior to their release."

Motta said the selling of the Yazidis is conducted through intermediaries in areas under IS control. Prices vary, but are reportedly lower if the buyer is not known to be someone acting on behalf of the Yazidi community or Kurdish Regional Government. Some local Iraqis have taken advantage of this disparity and secretly purchased the freedom of Yazidis before they are ushered to Iraqi Kurdistan. Getting caught has a heavy price — last week a Sunni Arab man was reportedly killed for trying to do so.

The UN says the Islamic State's atrocities against the Yazidis likely amount to genocide. Last summer, the group summarily executed hundreds of Yazidi men and captured several thousand others, including as many as 2,500 women and girls. Those who escaped have largely fled to refugee camps in Kurdish-controlled areas.

Many of the captured women were turned into sex slaves who were sold or simply offered to fighters. Reports soon emerged of open-air markets where girls were treated as merchandise. In October, IS attempted to justify the treatment of Yazidi females by dubiously citing Islamic doctrine, a move that was ridiculed by prominent Sunni religious figures across the world.

Numerous reports have since recounted the treatment of women and girls under IS control. In March, the UN found the group had taken girls as young as six as sex slaves. Earlier this month, Human Rights Watch released interviews with a number of escaped women and girls who recounted being raped and "owned" by multiple fighters. Through all of it, IS used the morbid veneer of the girls' status as slaves to justify these atrocities.

For a community torn apart and split between captivity, refugee status, or death, it can be a heart wrenching decision to pay — or having someone else pay — their tormentors.

"One old man in a camp in Dohuk told me that intermediaries had informed him that ISIL were demanding $60,000 to purchase his two daughters," said Motta. "He was crying as he said that he would never be able to obtain that sort of money to get his daughters released."

Most of the 217 freed Yazidis were elderly or women, and it's unclear how much was paid for their release. The source of the funds is also unknown. In other cases, Yazidis have been spirited to safety without going before religious courts. On Thursday, the Turkish newspaper _Hurriyet Daily News _reported that the Kurdish government had purchased the freedom of some Yazidis for amounts ranging between $1,000 and $10,000.

Even if the release of the Yazidis was a result of the Islamic State's depleted coffers, any sense among its militants that their position is weakening could put remaining captives, which the UN estimates to be as many as 3,000, at greater risk.

"There are also fears that as government forces make advances ISIL may resort to killing these captives [rather] than risk them being freed," said Motta, who added the UN had recently confirmed 500 Yazidi men had been separated from other prisoners in Tal Afar, raising fears that they would be executed.

'One old man in a camp in Dohuk told me that intermediaries had informed him that ISIL were demanding $60,000 to purchase his two daughters.'

Prior to the April 4 release, local authorities reported that 974 Yazidis, including 513 women and 304 children, had escaped IS captivity and made it to Kurdistan. They joined more than 637,000 refugees who fled in 2014 from Iraq's Nineveh province, where most Yazidis lived previously. As female captives began trickling out of IS-controlled territory, some human rights officials expressed concern that they would be ostracized or rejected by the conservative Yazidi community, or even subject to honor killings. In large part due to intervention by Yazidi religious leaders, who urged relatives to accept the traumatized women and girls back into the community, the worst of those fears have been averted.

Still, there is heavy stigma associated with the assaults the women and girls suffered. While in captivity, some of the women reportedly tried to disfigure themselves, evidently to lessen their chances of being raped.

"They would rub themselves with a corrosive substance on their faces and bodies to make themselves look ugly," Amber Khan, a gender and human rights advocate at Women for Women International, told VICE News. "They cut their eyelashes, shaved eyebrows, cut their eyebrows in ways that were again intended to make themselves look unappealing."

Khan said women and girls are hesitant to report what happened to them. "One of the biggest challenges, and this is not unique to this conflict, is the tremendous stigma and shame that women feel," she said.

The Kurdish Regional Government, along with aid groups, has offered support where it can. But local authorities have also employed questionable practices — including so-called "virginity tests" — in their attempts to document crimes. Such examinations, which determine if a female's hymen is intact, are considered inaccurate, unscientific, and usually an invasion of a person's privacy.

Related: Yazidis in Iraq Are Surrounded by Islamic State Militants and Slowly Dying of Thirst

Rothna Begum, Human Rights Watch's women's rights researcher for the Middle East and North Africa, told VICE News that the tests, which are carried out by a local committee established to document IS atrocities, require a court order and consent from victims. Women and girls often agree to the examinations because of the importance attached to their virginity — so much so that some have requested so-called "restoration" surgeries to reconstruct their hymens.

Human Rights Watch has learned from Kurdish authorities of at least 12 cases where traumatized girls who were raped asked for reconstruction surgeries. Begum described it as a fairly minor procedure, and local authorities explained to her that the many girls improved psychologically after it was completed. She said that while those mental effects shouldn't be downplayed, the procedure only cemented an unempirical physiological conception of trauma, and did not address long-term psychological distress.

Begum also confirmed that some girls and women raped by IS militants are undergoing abortions. Kurdish authorities insist that they abide by Iraqi law, which bans abortions except when the life of the mother is in danger. Local health officials have said that policy does not extend to women at risk of suicide or honor-based violence. Begun said she knows of at least six clandestine abortions among Yazidi women.

"We are concerned that if the official policy is maintained, women will be less likely to come forward for medical treatment," said Begum. "It also means they will not be getting legal and safe abortions."

For the time being, Yazidis and their Kurdish hosts will try to buy back their lost women and girls any way they can — even if it in some way endorses the Islamic State's conception of them as slaves.

The UN's Motta said the continued purchases risk inflating the price IS will demand, but he added that if "there is no other way to free these people from the horrors that are being inflicted on them on a daily basis, and if this is the way to do it, then so be it."

Follow Samuel Oakford on Twitter: __@samueloakford