Nadia Murad has shared her harrowing experience of being captured, beaten and sold as a sex slave by Islamic State militants in a new book published on Tuesday.

In 'The Last Girl: My Story of Captivity and My Fight Against the Islamic State', Murad, 24, recounts her life in a northern Iraqi village, her brutal captivity, tension-filled escape and feelings of betrayal and abandonment by those who failed to help.

Murad is Yazidi, a religious minority who live in an uneasy existence with their Muslim neighbors. In 2014, she was one of about 7,000 women and girls captured by the hard-line Sunni Muslim fighters who view Yazidis as devil worshippers.

Yazidi men and older women, including five of her eight brothers and her mother, were killed. The younger women and girls were held in captivity for sex.

Nadia Murad, 24 (pictured, May 2016), has detailed in her new book what it was like to be captured as a Yazidi sex slave for the Islamic State three years ago

Murad was abducted at age 21 from the village of Kocho near Sinjar, an area that is home to about 400,000 Yazidis, by hard-line Sunni Muslim fighters who view Yazidis as devil worshippers (Pictured, Murad reacts as she visits her village for the first time since being captured, June 2017)

Murad was registered as a slave and even had a photo ID that would be dispersed among the fighters if she were to run away. Her new owner was a high-ranking ISIS judge named Hajji Salma (Pictured, Murad cries as she visits her village for the first time since being captured, June 2017)

'It never gets easier to tell your story. Each time you speak it, you relive it,' Murad writes in her book.

'[But] my story, told honestly and matter-of-factly, is the best weapon I have against terrorism, and I plan on using it until those terrorists are put on trial.'

United Nations investigators estimate more than 5,000 Yazidis were rounded up and slaughtered in the 2014 attack, and UN experts have said the Islamic State was committing genocide against the Yazidis in Syria and Iraq.

In September, the UN Security Council approved the creation of an investigative team to collect, preserve and store evidence in Iraq of acts by Islamic State.

International human rights lawyer Amal Clooney, who represents Murad and wrote the foreword to 'The Last Girl', is campaigning for the Islamist group to be prosecuted through the International Criminal Court.

Murad was abducted at age 21 from the village of Kocho near Sinjar, an area that is home to about 400,000 Yazidis.

Murad's new book 'The Last Girl: My Story of Captivity and My Fight Against the Islamic State' was released on Tuesday

'Our Sunni neighbors could have come to us and tried to help,' she writes. 'But they didn't.'

Murad was registered as a slave and even had a photo ID that would be dispersed among the fighters if she were to run away.

Her new owner, a high-ranking ISIS judge named Hajji Salma, told her: 'You're my fourth sabiyya (sex slave). The other three are Muslim now. I did that for them. Yazidis are infidels - that's why we are doing this. It's to help you.'

Recounting the seemingly endless rapes by men who bought and sold her was clearly difficult for Murad.

'At some point, there was rape and nothing else. This becomes your normal day,' she says in the book.

'You don't know who is going to open the door next to attack you, just that it will happen and that tomorrow might be worse.'

Murad detailed how she tried to escape by wearing abaya, the robe-like covering that devout Muslim women wear, and crawling out a window.

She was caught by a guard. Hajji Salman whipped her and let his sentry made up of six men gang-rape her until she was unconscious.

Over the next week, she was passed to six other men who raped and beat her, before being given to one who planned on taking her to Syria.

Murad wrote about how she once tried to escaped by wearing an abaya and crawling out a window. She was caught by a guard, and her new owner whipped her and let his sentry made up of six men gang-rape her until she was unconscious (Pictured, Murad, left, with Lamia Haji Bashar, another sex slave survivor as they receive the 2016 Sakharov Human Rights Prize)

Murad finally escaped by jumping over the garden wall of her captor's house in Mosul. From there strangers helped smuggle her to a refugee camp (Pictured, Murad, left, and international human rights lawyer Amal Clooney at UN headquarters, March 2017)

Murad is currently being represented by international human rights lawyer Amal Clooney and she became a UN Goodwill Ambassador for the Dignity of Survivors of Human Trafficking this year (Clooney, second from right, and Murad, right, at UN headquarters, March 2017)

Murad then saw a fleeting opportunity to jump over the garden wall of her captor's house in Mosul. After wandering the streets cloaked in an abaya, she made a daring decision to knock on the door of a stranger's house and ask for help.

That was a huge risk, and she later learned her niece, also enslaved, had been turned in six times to the Islamic State by people she had asked for help.

'Families in Iraq and Syria led normal lives while we were tortured and raped. They watched us walk through the streets with our captors,' she writes. 'They let us scream in the slave market and did nothing.'

Murad was lucky that the strangers she found in Mosul helped smuggle her to a refugee camp.

With the publication of her memoir by Tim Duggan Books, Murad says she wants to see Yazidis in captivity released, the resettlement of survivors, the removal of landmines in the Sinjar region and prosecution of Islamic State.

But more than anything else, she says: 'I want to be the last girl in the world with a story like mine.'

She now lives in Germany and has become a campaigner on behalf of the Yazidi community. This year she became a UN Goodwill Ambassador for the Dignity of Survivors of Human Trafficking.