A Yazidi teenager who spent months in ISIS captivity has written a book describing her experience and her time as a sex slave for the terrorist group.

Shirin, a pseudonym, was 17 years old when ISIS (also known as the Islamic State, ISIL, or Daesh) took over her village in northern Iraq.

ISIS fighters encircled the town in August 2014 and made sure none of the women or girls were able to escape, according to the German international broadcaster Deutsche Welle.

In a book about her ordeal, written in German, Shirin describes her abduction (as quoted in the Daily Mail):

We were so blind. We didn't recognize the danger. Then at around 4 p.m. ISIS fighters told our village head, "We will not do anything to you as long as all of your daughters are brought to us by 6 p.m."

In two hours they wanted all of the girls outside. The news spread like wildfire. Our village head told us all, "Take your daughters and try to flee. Otherwise they will take your daughters and your wives."

Shirin and her family were unable to get away in time. She was taken as a sex slave and abused over the course of several months, according to Deutsche Welle and the Daily Mail. Shirin wrote about how she recognized some of her abusers as her former neighbors.

"Muslim Kurds, Arabs and Yazidis were like a big family for me before all of this," Shirin wrote, according to Deutsche Welle. "It was only after the terrorists seized power that our neighbors suddenly no longer wanted to even eat with us. ... Workers, teachers and doctors — all of our Arab neighbors seemed to have joined the [Islamic State]."

The invading ISIS members leered at the women in the village when they arrived to take it over.

"They openly looked us girls up and down and laughed dirtily amongst each other," Shirin wrote. "Their looks made us frightened and disgusted, their beards were long and unkempt."

The militants have enslaved thousands of people from the Yazidi ethnic minority in the Middle East. ISIS considers them infidels because their religion does not have a holy book like the Koran or the Bible.

ISIS allows its fighters to take Yazidi women and girls as sex slaves and "wives." Shirin was married off nine times, once to a 60-year-old man who impregnated her, she wrote. The last man she was "married" to helped her escape to Germany.

After ISIS captured Shirin, she was taken to a hideout with other women where they were "hit, attacked, raped by men high on drugs," and "left to starve and not given anything to drink," she wrote.

Displaced people from the minority Yazidi sect, fleeing violence from forces loyal to the Islamic State in Sinjar town, walk toward the Syrian border. Thomson Reuters

Shirin wrote that some of the men would remain masked while they assaulted her, but some of them didn't bother covering their faces.

"When I saw their faces for the first time it was only then that I realized I was looking at the faces of my former neighbors," she wrote.

The assaults were "such pain, such humiliation," she wrote.

Shirin is safe in Germany now, but she wrote that isn't the same person she once was.

"I never thought something so bad could happen," she wrote. "I was split from my mother, and then I was beaten. I tried to kill myself. I always thought it could not get any worse and then it did."

She wrote that she gets "panicked and scared" when she sees any bearded man coming toward her in Germany, and she also fears cars and buses because of the was she was transported from location to location. She was kept in an overcrowded school and the moved to an abandoned prison, according to DW.

Deutsche Welle interviewed Alexandra Cavelius, the German journalist who wrote down Shirin's story. She told the broadcaster that Shirin's love of life has disappeared and she isn't able to think about her future because of the trauma she suffered.