The day before Isis came was a holiday in Sinjar district, northern Iraq. Yazidis gathered to celebrate the end of a fasting period. It was 2 August 2014. Harvested wheat fields stood short and stubbly under the shadowless sun. People slaughtered sheep and gathered with their relatives to celebrate the holiday, handing out sweets and exchanging news and gossip. In the past, they would have invited their Muslim neighbours to join the celebrations, but more recently a distance had grown between them, leading the villagers to keep mostly to their own.

The atmosphere was restless and the temperature peaked above 40C (104F). The top of Mount Sinjar, just north of the town of Sinjar itself, appeared to be shimmering in the heat, and the people living below mostly avoided travelling until after the sun had set, when the streets were filled with neighbours trading fearful rumours, and men patrolling with guns.

At dusk, unfamiliar vehicles started to appear. The lights of the cars could be seen moving in the desert beyond the outlying villages. A sense of foreboding grew as darkness fell. The Yazidi men took their guns and set out to check the horizon beyond the wheat fields, peering toward the villages.

On their return, they gathered in Sinjar town centre in small, tense groups. Convoys of cars, kicking up dust in the distance, had appeared two months before, just before the city of Mosul – the capital of Nineveh province, of which Sinjar is a part – fell to Islamic State (Isis). Mosul is 120km (75 miles) east of Sinjar, and its capture was quickly followed by the fall of other towns. Four divisions of the Iraqi army collapsed, including the third division, which was based around Sinjar and included many Yazidis. The area was almost completely defenceless.

When they seized Mosul, Isis freed the Sunni Muslims from the city’s Badoush prison and executed 600 Shia prisoners. The group plundered weapons and equipment from Iraqi army bases. Soldiers scattered their uniforms, and half a million civilians fled north and east. Within a week, a third of Iraq was under Isis control. Sinjar district, with a population of around 300,000, was surrounded. Only a thin strip of contested road remained, linking them to the relative safety of the Iraqi Kurdistan in the north – but the journey was dangerous.

The Kurdistan region in northern Iraq is semi-autonomous, and guarded by the peshmerga, who now had to defend the four Kurdish provinces against Isis. “Peshmerga” means “those who face death”, and the word is heavy with the historical import of the Kurdish struggle against oppression. In the south-east of the region, on the Iranian border, part of the peshmerga clashed with Isis, but near Sinjar, an uneasy stillness hung in the air like a tension headache that comes before a storm.

Leila is from a family of Yazidi farmers and shepherds. She is small with a pale, girlish face, even though she is 25, and gives off a kind, practical air. She has two younger sisters and three older brothers. As a child she worked on the family farm with her brothers, and after a spate of sheep thefts on their ranch, they decided to move closer to Kojo, a village below Mount Sinjar.

Leila’s brothers had joined the peshmerga after the US-led invasion of Iraq in 2003. On 2 August 2014, their colleagues in nearby Siba Sheikheder came under attack from Isis and called for help. Siba Sheikheder, south of Sinjar, is the closest Yazidi town to the Syrian border, a collection of a few hundred squat buildings. By mid-morning on 3 August 2014, the peshmerga stationed in Kojo had fled. In the confusion, Leila’s family and around 100 others decided to run, but most people stayed, unsure what was going to happen to them.

Leila’s younger sister was living in Siba Sheikheder with her new husband, and phoned home to her parents that morning: “We’re running – Isis is coming,” she said. Leila and her family drove north to Sinjar, leaving her uncle at home to guard the house. Arriving in Sinjar, they realised the town was already under attack and its people were fleeing. Gathering together in a patch of scrubland outside Sinjar, they phoned her uncle. He told them the area was surrounded and Isis would not let anyone leave.

Displaced Yazidis from Sinjar fleeing Isis walk towards the Syrian border, August 2014. Photograph: Rodi Said/Reuters

They were trapped. Shortly after the phone call, a group of Isis fighters approached them and told them to hand over money, guns, gold and phones. Leila remembers that the leader had a red face and beard and was called “emir” (“prince”) by the others. Fighters drove her family to one of the central government offices in Sinjar, where ID cards used to be issued. What seemed like thousands of women and girls had been gathered inside the building’s offices, with men crammed together on the second floor. At around 9pm, Isis guards brought lanterns inside and began inspecting the faces of the women and girls. The women huddled together for protection, and as the men drew near to Leila, she was so scared that she fainted. This saved her from being taken away that night. Five of her female cousins were not so lucky.

The Yazidi women in Sinjar didn’t realise it yet, but the Isis fighters were carrying out a pre-planned mass abduction for the purpose of institutionalised rape. Initially they were looking for unmarried women and girls over eight.

When Sinjar district was attacked by Isis, more than 100,000 people fled to take refuge on Mount Sinjar. Those who couldn’t flee were rounded up. Many of the men were massacred. Thousands of Yazidis were either executed and thrown into pits, or died of dehydration, injuries or exhaustion on the mountain. So many people were missing that the enslavement of women didn’t immediately come to international attention.

According to Iraqi MP Vian Dakhil, herself a Yazidi from Sinjar, an estimated 6,383 Yazidis – mostly women and children – were enslaved and transported to Isis prisons, military training camps, and the homes of fighters across eastern Syria and western Iraq, where they were raped, beaten, sold, and locked away. By mid-2016, 2,590 women and children had escaped or been smuggled out of the caliphate and 3,793 remained in captivity.

The Yazidis are a majority-Kurdish-speaking religious group living mostly in northern Iraq. They number less than one million worldwide. The Yazidis, throughout their history, have been persecuted as infidels by Muslim rulers who demanded that they convert. Rather than formal ceremonies, their religious practice involves visiting sacred places. Yazidis participate in baptism and feasts, sing hymns and recite stories. Some of the stories are about historical and mythical battles fought in protection of the religion. Others, told over the centuries by generations of women, detail methods of resistance to the same threats that Yazidi women face today.

The Yazidis had already been made vulnerable by forced displacement under Saddam Hussein, economic meltdown under UN sanctions, the breakdown of the state and security after the US-led invasion of 2003, and the political failures that followed. In Iraq there are now around 500,000 Yazidis, primarily from the Sinjar region in Nineveh province in the country’s north. The Yazidis of Syria and Turkey have mostly all fled to neighbouring countries or to Europe. In Germany, their numbers are estimated at 25,000.

“Not all violence is hot. There’s cold violence, too, which takes its time and finally gets its way,” Teju Cole wrote in a 2015 essay about Palestine. Around the world, a broader kind of cold violence continues. It’s the violence of indignity, of forgetting, of carelessness and of not listening. It’s there in the way politicians talk about refugees, and in the way the stateless are sometimes written about and photographed by the western media. It’s there in the fear of outsiders. It’s there in the way humans dismiss other humans as less worthy of protection or care. When cold violence and hot violence merge, we get mass killings inflicted on the most vulnerable.

Yazidis have suffered massacres and oppression for generations. But there was something different about the Isis attack that took place in the late summer of 2014. This time the media took notice.

Many of the stories about the abduction and enslavement of Yazidi women and children described them as “sex slaves” and featured graphic, sometimes lurid, accounts by newly escaped survivors. The female fighters of Kurdish militias helping to free Yazidis from Mount Sinjar became fodder for often novelty coverage. The Yazidis became the embodiment of embattled, exotic minorities set against the evil of Isis. This narrative has stereotyped Yazidi women as passive victims of mass rape at the hands of perpetrators presented as the epitome of pure evil.

It was only much later in my reporting on how some Yazidi women managed to escape and return that I became aware of how important stories of captivity and resistance were to dealing with trauma, both historically and in relation to Isis. Yazidism is a closed religion and identity, one that is passed down through generations by stories and music. These practices have been extended to dealing with the traumas of their treatment at the hands of Isis.

Many of the women and children captured in Sinjar had seen or heard their male relatives being killed by the armed Isis fighters who now surrounded them. In jails across Iraq and Syria, where the women were held, they felt a sense of “abject terror on hearing footsteps in the corridor outside and keys opening the locks”, said a report by the UN commission on Syria that designated the Isis crimes against the Yazidis as genocide. “The first 12 hours of capture were filled with sharply mounting terror. The selection of any girl was accompanied by screaming as she was forcibly pulled from the room, with her mother and any other women who tried to keep hold of her being brutally beaten by fighters. [Yazidi] women and girls began to scratch and bloody themselves in an attempt to make themselves unattractive to potential buyers.”

At first, the women and girls were taken to prearranged locations in Iraq where they were handed out to the Isis fighters who took part in the attack on Sinjar. To avoid being raped, some of the girls killed themselves by slitting their wrists or throats, or hanging themselves, or throwing themselves from buildings.

Amid the panic in the Sinjar ID office, Leila decided to pose as a mother to her small niece and nephew after she saw the other women being taken away, and correctly assumed that being unmarried was dangerous. The following day, the Yazidi men on the second floor disappeared.

Leila was transported 50km east to a school-turned-prison in Tel Afar, where the women were crowded into classrooms functioning as cells, guarded by fighters who continued to pick out beautiful girls to serve as slaves. Each time they were moved, their names and ages were noted down on a list.

In the coming weeks, some Yazidis managed to escape by walking through the night across muddy fields, keeping to the valleys to avoid Isis checkpoints and reach the peshmerga. It was in those first few days that the Yazidis could most feasibly have been rescued. The captives were held together and some still had mobile phones hidden under their clothes to call relatives back in Kurdistan and tell them exactly where they were. But with little by way of rapid international or governmental support materialising, a sense of abandonment soon grew among the families waiting for their loved ones.

“Within days of what happened to the Yazidis on the mountain, the phone calls went from ‘help us survive’ to ‘they’ve kidnapped these women and can you help us to rescue them,’” said Tom Malinowski, then the US assistant secretary for democracy, human rights and labour, when interviewed in February 2016 during a visit to Erbil, the capital of the Kurdistan region. “Hostage rescues are one of the most dangerous things to do, but when they [the women] were still being held in large groups this was discussed, but tragically they were then dispersed … It is still very much on our minds and something we know has to be considered.”

To date there have been no known, large-scale rescue missions to free the Yazidi captives in Iraq and Syria, by either the US, Iraqi or Kurdistan regional governments.

According to Isis, it has no choice but to attack and kill disbelieving men. Flowing from this, it justifies the enslaving of their women as an act of protection, a way of replacing the men who previously looked after them. This idea is crucial to the role of slavery in Isis’s conception of how a caliphate should function.

Implicit in the goal of eliminating the Yazidi community is the idea that society would be better without them, which is common to all genocides, said former UN investigator Sareta Ashraph. The enslavement, for Isis, is meant to eventually bring the women to Islam, and is part of their ideology of conquest. “[It is] among the greatest forms of the honour of Islam and its sharia [Islamic law], as it is a clear affirmation showing the supremacy of the people of sharia, and the greatness of their affairs, and the dominance of their state, and the power of their might,” according to an Isis pamphlet on slavery.

Isis describes its own use of enslavement through a mix of clumsy metaphors about sex, war and power. Dividing up the captive women and children among the Isis mujahideen [holy warriors] and “sanctioning their genitals” is described as a sign of “realisation and dominance by the sword”.

Katherine E Brown, a lecturer in Islamic studies at the University of Birmingham, explained that Isis mainly justifies its use of slavery through selective interpretations of the hadith, the reported accounts of the life and sayings of Muhammad and his companions: “They justify it on the basis that it is a reward for carrying out services for the community – slaves are presented as compensation for fighters. However, they chose particular ways of seeing these hadith, and selectively choose them so as to ignore, for example, the requirement not to kill your prisoners by focusing on the requirement to make sure they ‘don’t escape’ by being ‘secured at the neck’ until negotiations have taken place.”

A Yazidi woman in the northern Iraqi town of Dohuk, May 2015. Photograph: Safin Hamed/AFP/Getty Images

The promise of sexual slavery is used as a sweetener when recruiting disaffected young men to Isis. At the same time, media stories about sex and violence involving non-Muslim women being enslaved by Muslim men feed stereotypes about Muslim men that create divisions that Isis can then exploit.

“Slavery serves to increase the Isis community because Yazidi women will give birth and the children will be brought up among its fighters,” writes the author of the Isis pamphlet.

The same document calls on fighters to treat their slaves well, citing words from the Qur’an calling for them to be good to “those whom your right hand possess” – a euphemism for a female captive – and cites Islamic texts with instructions not to hit the slave’s face, and to emancipate the slave who becomes a believer, for which the master will be rewarded by God.

But, as with other strictures, there is a gap between Isis proclamations and an abusive, often violent reality. Isis used gang rape as punishment for women and girls who tried to escape to further degrade and control them physically and psychologically. Despite this, many of the women continued to fight back against their captors, risking punishment and death in pursuit of freedom.

After the women were captured, they didn’t immediately become slaves to the fighters, but were held for a period while their details were recorded. The process was systematised. Women were then sold in markets, either electronically over a mobile phone messenger app where their photos and slave numbers were exchanged, or in market halls and prisons at prearranged times.

Away from the main markets, women and girls, supplied by fighters or Isis members who acted as middlemen, were sold by local brokers in smaller numbers. At the beginning, they were given mainly to Iraqi fighters who took part in the battle for Sinjar. Subsequently, the remaining captives were taken to Syria, and sold there, often to fighters who had arrived from around the world.

In late 2014, a group of young, bearded men sat on long sofas lining the walls of a living room somewhere in the caliphate, wearing ammunition-packed vests. They joked with one another. “Today is distribution day, God willing,” said one of the men, as he flashed a grin at his companions. “You can sell your slave, or give her as a gift … You can do whatever you want with your share,” said another fighter in view of the cameraman who was recording the exchange. The men didn’t seem to notice and continued discussing buying women for “three banknotes or a pistol”.

By the summer of 2013, Raqqa, 370km west of Mosul in northern Syria, became Isis’s de facto capital, and supporters from all over the world flocked there to join the group. It was also the destination for other women from Sinjar.

“When we got to the farm [near Raqqa], we saw four or five buses full of Isis members with long hair and beards,” said Zahra, a farmer’s daughter from Kojo. “They were like animals. On the first day they came among us and started picking girls for themselves. Two or three of them would catch the girls, blindfold them and take them by force into a car. The girls were crying and shouting but they didn’t care.”

From the second floor of the building, the girls could see the Euphrates river, but they were hidden from view by the surrounding trees and fences.

“We were just like sheep, when the shepherd goes toward them and the sheep disperse; that’s how we were, running away from them,” said Zahra. She fled when the men came, but she was blocked by a fence at the edge of the farm. On the first day the men took 20-40 girls. Food was delivered from a local restaurant for those who remained, but they were too scared to eat. They covered their faces with ash to try and look unattractive in the hope that they wouldn’t be picked.

After two days, Zahra and her sister were taken to an underground Isis prison in Raqqa. Hundreds of women were crammed into three rooms in what was just one of several similar structures that were used for holding women in Raqqa. The girls arrived at night and weren’t allowed to see the outside of the building – a tactic similar to that used by the Syrian government in its jails, said Sareta Ashraph.

A Yazidi woman abducted by Isis is carried to safety near Mount Sinjar. Photograph: Channel 4

Inside the prison, the women had to share a few filthy, overflowing toilets, forcing them to stand in raw sewage. Their bodies were crawling with sand flies. The only light came from two solar-powered lamps hanging from the ceiling, one prisoner recalled. Each morning the guards would give them a small piece of bread and cheese to share between two, and in the evening some rice and soup.

Some women sat on bags or clothes to try and avoid touching the filthy ground. Children cried constantly with hunger. The women waited under the constant fear of rape or death. “They were always beating us and we had diarrhea because of the fear,” said a woman I shall call Khulka, who is 30 years old and comes from the town of Tel Qasab. She had arrived at the prison with her four children, inside a refrigerator truck normally used for ice-cream. “We didn’t have a shower for one month and we always had lice in our hair. After two months they took us outside, but we couldn’t stand because we hadn’t seen the sun for so long,” she said.

While in the jail, Khulka tattooed herself with the names of her husband and father, so that her body could be recognised and returned to them if she was killed. She mixed breast milk from a lactating woman with ash, and used a needle she had smuggled into the jail. With the same needle and some thread, she began embroidering her underwear with the names and numbers listed in her phone in case Isis found it and took it away. Khulka had been to school, and unlike many of the women there, she knew how to read and write. She also sewed other women’s clothes with their loved ones’ names and numbers so that they would not be forgotten.

Historically, Yazidis associated formal education with repressive state authorities, the suppression of their language, and the threat of religious conversion. In the years before 2014, literacy rates had been improving in Sinjar, but many women and girls worked in the fields to support their families while their brothers went to school. Illiteracy made it harder for women to escape after they were taken into captivity, because they couldn’t read the signs on unfamiliar buildings in Isis-held towns and cities.

Khulka was taken to a side room in the prison with her children and photographed by the Isis guards who gave her the slave number 16, which was then printed above her photo. There were around 500 women in the jail, she recalls, and all of them had to pose with their children and were given slave numbers. Before the picture was taken, she cut her daughter’s hair to make her look like a boy and stop them being separated. If the guards recognised her daughter as a young girl, there was more chance she’d be taken. The other imprisoned women envied Khulka’s grey hair, thinking it might save her from being seized. They tried to imitate it using ash.

“Some of these women and girls resisted forced conversion, protected themselves against violence, or at least tried to, and protected their children. How they resisted really shows incredible intelligence, courage and strength,” said human rights lawyer and gender justice advocate Sherizaan Minwalla.

Yazidi women who fled what is now Turkey during the first world war and the chaos that followed passed down stories that are repeated among Sinjaris today. Among them are accounts of how they did as Khulka was now doing: covering their daughters’ faces with ash and cutting their hair.

In the same prison, Zahra and her sisters were put together into small rooms. They heard screaming and crying as Isis guards came in the middle of the night to drag away the girls. The guards came for Zahra’s middle sister first. When Zahra pleaded with them not to take them separately, one of the guards whipped her with a cable.

After her sister was taken from the cell, the door opened again. This time Zahra was grabbed by two large men and shoved into a car. “I won’t go until you give me my sister!” she cried out. The men drove her to a house in Raqqa belonging to an Isis member who kept her as his slave, then sold her on after four months to another Isis fighter. He found her disobedient and sold her on straight away to a fighter of only 18, who lived at a compound for Libyan fighters near Deir ez-Zor in eastern Syria.

Many Yazidi girls were by being held in the same compound of 100 to 200 caravans where the Libyan fighters lived. The women and girls were chained, beaten, raped and passed around like animals between the men. At the edge of the compound, a barbed-wire fence prevented them from escaping. The stories of privation and torture suffered by Yezidi women in this compound are some of the worst in a long catalogue of abuses.

After a little more than a month at the farm, Leila and three other girls from Kojo were taken back to Iraq and kept in a military base near the Iraq–Syria border, more than 200km south of Sinjar in Anbar province. The military base was in Al-Qa’im, a border crossing between Iraq and Syria, but by that time, under the caliphate, it was merely a pitstop between Isis-held stretches of desert. It was also a common crossing point for slaves passing between markets in Isis towns and cities. Leila was sold to a man called Muhammad, who looked familiar to her. Then she remembered who he was: his family were like godparents to her family.

When Leila recognised Muhammad, she was relieved: she thought he would rescue her, and maybe sell her back to her family. Instead, he sold her on. Three days later, Leila was taken to a military base near Ramadi and sold to an Isis military commander. Later, after she had escaped and was in Baghdad, someone asked her what she would do if she saw Muhammad again. “I would burn him alive,” she said.

The Isis commander who bought Leila in Ramadi was a notorious sadist known as Shakir Wahib, who had been terribly wounded in fighting, and was now trafficking women for sex and organising gang rapes. When one woman arrived in early 2016, having held on to a mobile phone, Leila managed to call her brother in Kurdistan and told him he needed to send someone to rescue her before the woman was moved on, and her phone with her. For two days, calls went back and forth between Leila and a smuggler called Abdullah, who eventually helped her to escape. Abdullah used to work in Aleppo and had a wide network of business contacts in Syria and Iraq. He had become a smuggler after 50 members of his family were kidnapped by Isis.

Most of the smugglers working to rescue Yazidi women are Yazidi businessmen. Some of the women are bought back from the Isis fighters holding them, or from the slave markets or online auctions. The cost of smuggling is reflective of the danger involved. It’s not clear how much of the cash ends up with Isis, and how much goes to middlemen or the smugglers.

This black market thrives because families are left with no other options. The war against Isis continues to win back territory from the militants, but Yazidis told me that they would prefer the focus to be on saving their captive women and children, rather than winning back terrain.

Yazidis displaced by Isis in a camp near Dohuk, Iraqi Kurdistan, January 2015. Photograph: Safin Hamed/AFP/Getty Images

After reaching Baghdad, Leila and her niece travelled north by plane to the Kurdish city of Sulaimaniyah, and then by road to the camps where many Yazidis from Sinjar had taken refuge, and where their families were waiting. When Leila arrived, she collapsed sobbing into the arms of her female relatives. She was in such a state of shock that, for the first few weeks, she had trouble understanding what her family were saying when they tried to talk to her.

“Sometimes I watch the TV and I see the news of the army taking more land and villages, but it’s not this that we are worried about – it is our people who are still imprisoned,” Leila said. “We know most of them are in Raqqa, so why are [the army] not going to save them there?”

The failures have been broad and deep. Earlier this month, Iraqi forces, backed by coalition air cover, declared victory over Isis in Mosul. But for many, the price of that victory was high: civilians were killed by Isis as they tried to flee, as well as being bombarded by Iraqi forces and the coalition. In March 2017 a US airstrike on a house where families were sheltering in western Mosul killed more than 100 civilians.

Attention has now moved from Iraq to the presence of Isis in Syria, and the battle for Raqqa. As Iraq’s politicians and their military patrons prepare to congratulate themselves, the Yazidi community looks on from displacement camps, rented homes or forced asylum overseas. Almost two years after it was cleared of Isis by Kurdish forces, Sinjar town remains in ruins. A new wave of fighting for Sinjar district is under way, with Turkey eyeing a violent incursion after bombing the area in April. The idea that this represents “liberation” is seen by Yazidis as a bad joke. The UN and others have tried to recognise and document the genocide, but justice looks a long way off. Meanwhile, the battle for survival of the women and girls who were taken by Isis continues long after their return.

Sinjar was recaptured from Isis by Kurdish forces, led by the peshmerga, in November 2015. Since then the peshmerga and other Kurdish armed groups have been in a hostile standoff with each other, with rival groups providing arms, training and patronage to local Yazidis. Brightly coloured flags of the various groups flutter above their respective checkpoints, which are sometimes only metres apart along roads that were recently controlled by Isis.

Yazidis now fear renewed attacks not just from Isis, but also from their Kurdish liberators. Yazidis themselves are not politically homogenous, and many distrust the rival Kurdish groups. By May 2016, despite the liberation, only 3,220 families had returned to Sinjar district.

While the infighting goes on, Isis stands only to gain. Yazidis are stuck in a complex series of client-patron relationships with Kurdish leaders, in which ethnic identification is used in exchange for promises of safety. Meanwhile, the Yazidis remain unable to define their future, militarily or politically. While military clashes continue, any political settlement to the rivalry between liberating forces looks a long way off.

Main photograph: Rodi Said/Reuters

This is an edited extract from With Ash On Their Faces: Yazidi Women and the Islamic State by Cathy Otten, which will be published by Or Books in October.

• Follow the Long Read on Twitter at @gdnlongread, or sign up to the long read weekly email here.