No one wears shoes in Lalish. The village is so sacred that all visitors must walk its paths barefoot. Perched at the top of a narrow valley, in the parched, scrubby hills of northern Iraq, close to the Kurdish border, its cluster of shrines are a revered site for followers of the Yazidi faith.

At the heart of Lalish is a pool of water sheltered by a small cave, its entrance shaded by mulberry trees and watched by a guardian in a red turban. This is the “holy white spring”, where newborns must be brought for baptism, the waters mixed with the Lalish soil for the rites of marriage, birth and death. For generations, the rituals carried out at the spring had been unchanged. But two years ago, groups of women, usually silent, often with young children, began joining the families filtering in and out of the cave.

There were many times I wanted to kill myself, but I had to continue for the sake of my children

One recent late afternoon, one of these groups emerged, solemn and silent, shivering slightly as their headscarves, wet from the sacred pool, caught the evening breeze. All were survivors of Islamic State’s slave markets, where women are bought and sold. Inside the cave, they had prayed, washed their heads and faces, and been born again into the faith of their childhood.

“In Lalish, we were freed,” says Nour, a 28‑year‑old with a soft voice and easy smile that cannot quite hide her grief. Her husband is still missing, and she and her three young children are traumatised after 15 months in captivity, held by Isis fighters.

The simple ceremony at Lalish is vital to her recovery. Nour, who asked that her real name not be used, has made the pilgrimage five or six times, bringing one of her daughters along three times to help her rebuild her life. “These white clothes make me glad,” she says of the headscarves the women are given for their ceremony, and take home rinsed in the water of the sacred spring. “There were many times I wanted to kill myself, but I had to continue for the sake of my children.”

A visitor could be forgiven for thinking that these ceremonies were just another ancient tradition of the Yazidi faith. In fact, they are a radical and new response to the trauma inflicted on an entire community by Isis; before the grim summer of 2014, these rituals would have been inconceivable.

A Yazidi family at a shrine in Lalish. Photograph: Alessandro Rota/The Guardian

In August that year, Isis fighters, flush with weapons, cash and confidence from their extraordinary capture of Mosul, Iraq’s second city, cast around for a new target and alighted on the nearby Yazidi homeland of Sinjar, near the Syrian border. It was home to 400,000 Yazidis, living in villages and towns clustered around the base of Mount Sinjar. They made up perhaps half a global population, also scattered across Germany, the US and other parts of Iraq.

Isis was already known for its brutality, but its treatment of Yazidis marked a new height of bloodshed and cruelty. Isis fighters had dubbed them “devil worshippers”, because of their esoteric beliefs – which range from taboos on wearing the colour blue or eating lettuce, to their belief in a fallen “peacock angel” – and marked them out for particularly harsh treatment. Men and older women were massacred, their bodies dumped in shallow mass graves that now dot the mountain. Isis fighters still keep watch on some of the largest sites across the frontlines, sniping at visitors who might document their crimes. For the younger women, a different horror awaited.

Isis fighters established a system of sexual slavery, claiming that the rape of non-Muslims was a form of worship. They set up markets in several towns where girls as young as nine were put up for auction to militants, with owners often trading women again online.

“I was sold seven times, and lots of women had a much worse life than me,” Nour says of her battle to survive. She had two daughters, then aged three and four, and was pregnant with a son when her family was seized. Her husband was taken away after two days and is still missing.

Women cover their heads with white headscarves which have been bathed in the sacred spring. Photograph: Alessandro Rota/The Guardian

Soon afterwards, Nour gave birth in a freezing room, slipping out of consciousness as two fellow prisoners did their best to serve as midwives. “They had washed me. Because it was cold, they wrapped me in a lot of blankets, and after a while the elderly women told me: ‘Wake up, you have given birth to a child,’ ” Nour says. “I kept crying, because I hadn’t even realised that.”

Pregnancy had protected her from sexual slavery, but now Nour and her three children were taken to a wedding hall in Mosul. “Every day, the militants would come and tell us to stand up, put on our headscarves,” she says. “They were looking at the women, to see who was beautiful. They would take even those who were already married.”

She made herself look as dirty and dishevelled as possible, to evade selection, and tried to keep her son alive, feeding him on sugar water when her own milk dried up and the Isis fighters refused to provide formula milk. But when her son was two months old, they were sent to Raqqa.

I've been sold many times. If it was my choice, I wouldn’t do anything with any man except my husband, but they force me

There, she was selected for transport to the recently captured city of Palmyra, where there was a market for women, and forced to make a terrible choice between her children. “One of my daughters couldn’t walk, because she had had surgery on her leg, and I couldn’t carry her and my son,” she said. “So I left him with my husband’s relatives in Raqqa.”

In Palmyra, the women and their children were held in a large house, and every day militants took a few to the slave market for sale, returning with any who had not found a buyer by evening.

“The militants sold almost all the women, until it was just me and three others. Then one fighter bought me and took me to his house.” The man, a 26-year-old Syrian, “was very cruel”, she says. He raped her and regularly beat her two girls.

After two weeks, Nour escaped, breaking a lock and slipping into the night with her girls. But Palmyra is four hours’ drive from Raqqa and even further from the border; with no money, no telephone and no transport, they were reliant on the mercy of locals. None would help, even though Nour speaks Arabic and could explain clearly the horror of her situation. “I told them: ‘Isis are doing this and this and this to us, you have to help us, save us,’ but they refused.” At house after house, they were turned away, refused the use of phones or even a drink as the sun beat down on them. “I asked one family: ‘As you won’t let us in, could you just give me some water for my daughters?’ They refused even that.”

‘In Lalish, we were freed,’ says Nour, who was held captive by Isis fighters for 15 months. Photograph: Alessandro Rota/The Guardian

Palmyra is surrounded by desert, so there was nowhere to hide and no way to avoid the roads. By midday, Isis had recaptured them. She was returned to her “owner”, who later sold her to a Saudi fighter in Raqqa. She was sold twice more, until she and the girls ended up back in Raqqa with a Palestinian, who bought them from an online slave market.

He was married, and swore to Nour and his wife that he had bought her only to do housework and wouldn’t touch her; but he turned out to be one of her cruellest owners. She begged his wife for help, and the wife pushed her husband to sell the family on. Her next owner, apparently dazed by violence or seduced by Isis’s own myths, claimed he loved the woman he had bought online and demanded love in return.

“He asked: ‘Why are you crying?’ and I said: ‘I have been sold so many times. If it was my choice, I wouldn’t do anything with any man except my husband, but they forced me.’ So he said: ‘You are like my daughter, I won’t do anything if you don’t agree.’ ”

In an apparent bid to win her respect, the man she knew as Abu Orfman also tracked down her son, in the same internet slave market where he had bought her, and reunited them.

“He brought a laptop to me, which had pictures of all the women and children, and asked: ‘Which one is your son, who do you know in these pictures?’ I found his photo. They searched for 15 days and brought him to me,” she remembers. “We had been separated for over three months.”

The joy of the reunion was tempered by the horror of their situation. Her son had been given a Muslim name; he was destined for schools that turned young captives into Isis fighters.

A month later, after Nour refused to convert and marry Abu Orfman, he lost interest and sold her on. There was one more sale before a Yazidi ally, posing as a slave trader from Raqqa, bought Nour and her children freedom. “He looked like an Isis militant – he wore their clothes, and had a beard and something covering his face,” Nour remembers. But as he drove them away, he revealed he was taking them to her family. “I told him I couldn’t believe he wasn’t Isis, but he said: ‘This beard is fake. I only wear it to save women and girls.’”

A voice message from her father finally convinced Nour that her ordeal was over. She remembers the fierce joy of that moment, but also the fear that replaced it as she sped away from Isis territory. Now that she had won the battle to survive, she faced the looming question of whether she would ever really be able to go home; under Yazidi religious law, the women seized and raped by Isis should be evicted from their faith and permanently ostracised from their communities.

The things of the past belong in that time. We are now in the 21st century

The Yazidi faith is theologically diverse, with strands of Islam, Christianity and Zoroastrianism. It is strictly closed, so a child must be born a Yazidi to worship as one, and adults must marry a Yazidi to build a family in the faith. Any sexual contact with a nonbeliever means banishment, a strict bar that treats rape no differently from a consensual relationship. The faith is thought to date back as early as 1200, though some argue its roots go even further back. Violence against Yazidis has been so frequent over the centuries that their word for attempted extermination – ferman – long predates the coining of its English equivalent, genocide.

But while women abducted in these waves of violence have been grieved over, they have never been allowed to return to the faith. In some cases, they might even be murdered by their fathers and brothers, in so-called honour killings. There was no reason for Isis’s victims to expect the response this time would be any different.

Khider Domle is an academic, journalist and activist based in the northern Iraqi city of Dohuk, where the Yazidi population soared after Isis struck Sinjar. Poorer families cluster in refugee camps on its outskirts, while wealthier ones rent apartments in urban areas, but all have been affected by the stories reaching them from Isis-controlled areas. “I was working for a long time as a women’s activist, so I understood how difficult it would be for survivors to return,” Domle says. “In 2007, when a Yazidi girl converted to Islam to marry, her family carried out an honour killing. We wondered if this would be repeated.” he adds.

Domle, along with many Yazidis, began asking why their religious traditions gave extremists the very power they most craved: the ability permanently to exclude believers from their faith and family. He was soon part of a group determined to challenge the doctrine with which they had grown up, convinced that any women who escaped should be welcomed, not shunned. “This was a very profound change,” says Domle, who is full of nervous energy. “There are no comparisons in our history.”

A few people – mostly men, but some women – tell us not to visit the rescued women. They say: ‘Their honour is ruined'

Domle and other campaigners knew they would have to convince the Yazidis’ supreme spiritual leader, Khurto Hajji Ismail. Known to believers as Baba Sheikh, he is over 80 and frail, but his authority is undimmed. The complex where he lives and hosts visitors, a kind of Yazidi Vatican, is a disconcertingly ordinary concrete courtyard home on the backstreets of the nearest large village to Lalish. It was here that Baba Sheikh met the first two women to escape from Isis, and decided to jettison centuries of tradition, declaring them still members of the faith. “We brought them to Baba Sheikh’s house, and he welcomed them,” Domle says. “He said: ‘Don’t worry, you are real Yazidis, no one can touch you, no one can change your future.’ I thought: ‘Why don’t we make this official?’”

Days later, Baba Sheikh’s brother sought advice on a draft declaration, clarifying that women who had been enslaved by Isis should be welcomed back to the community. By mid-September 2014, an edict was issued in Kurdish, the main Yazidi language, to community leaders. The ceremonies at the Lalish spring, similar to a baptism, followed soon after, developed by religious leaders working with Yazda, a Yazidi-run charity which supports Isis victims.

Sitting on his terrace in the fading evening light for a rare interview, more than three years after that first welcome ceremony, Baba Sheikh bats away any suggestion that his response was extraordinary. “The women were taken by force,” he says slowly. “They didn’t choose this.” The head of a religion bound by tradition, he seems reluctant to concede that much has changed: “It is not new – we have this ceremony for children. When there is a new baby, they take them to be baptised in the sacred white spring. This is our ritual.” He concedes only that Yazidis needed to modernise. “The things of the past belong in that time. We are now in the 21st century.”

The change was swift, and unexpected enough that some more conservative Yazidis still grumble about the decision to allow survivors to return to the faith. “A few old-fashioned people – mostly men, but also some women – tell us not to visit the women who are rescued,” says 28-year-old Ghaura, who lost two brothers to Isis and now lives in a refugee camp. “They say: ‘Their honour is ruined, they shame all of us.’ ” But they are in a tiny minority now, she adds, with even the poorest of her neighbours more likely to scrape together a few dinars to donate towards ransom payments than ostracise Isis survivors. “Times have changed, people’s minds have changed. Baba Sheikh’s word means a lot. Even old-fashioned people listen.”

The Yazidis’ supreme leader, Khurto Hajji Ismail, known as Baba Sheikh, at his house. Photograph: Alessandro Rota/The Guardian

The Yazidis’ extraordinary collective decision to remake their religion has garnered little notice beyond their own community; but inside it, the change has been critical to many survivors’ efforts to heal. “When I returned home, everyone was so loving,” Nour says, although it has taken her many months to process her time in captivity. “I was very afraid to tell my story, even though the counsellors were female. I thought they also worked for Islamic State.”

The trips to Lalish are part of an effort to break down this sense of fear and isolation. “The women often say they get a sense they are not alone feeling this – the thoughts, the struggles with memories,” says Eivor Laegrid, a Norwegian therapist working with Yazda. “The feeling of companionship seems to be a first step to reintegrating.”

***

In the early morning of one recent outing, a group of women and children stare out of the windows of a minibus, sombre and lost in memories as the hills rush by, until the road turns up into the Lalish valley. As they stumble out and strip off their shoes, the children race to play around the complex of temples and shrines, but many of the women retreat into grief. “Open for us a door of light, for all Yazidi people, a door of mercy,” begs one woman whose daughter is missing. “Help my children who are in the hands of Isis.”

After lunch and a meeting with clerics who repeat Baba Sheikh’s welcome, the women end the day at the sacred white spring, and can return to repeat the rituals as often as they like. Nour is among those who have made several trips, as she seeks to shake off the trauma that has stayed with them all, particularly her younger daughter.

“Though she is six years old, if I leave her alone with a colouring book, she will rip all the pages out, stick all the pencils in her mouth. She hurts herself, and at night she sleeps under my arm as if she is full of horror.”