"The most important thing to me is that my dream came true and I was watching the one who raped me being sentenced to death," Haji Hamid said afterward.
"I want my story to reach the whole world, so my message is heard by my friends and gives them the courage to do the same thing that I did, so that they can get revenge on Daesh," she said, using the Arabic acronym for the Islamic State.
The chief judge in the case expressed a similar wish.
"We hope that if people hear about this case, others will come forward," said Judge Haider Jalil Khalil of the Kharkh Criminal Court in Baghdad. He said the judiciary had been hampered in bringing this kind of case by the reluctance of victims to testify in public.
In Iraqi society, it is especially difficult for women to speak out in public about rape, as Haji Hamid did, for fear that they will be accused of having allowed the men to rape them and that they will tarnish their family name.
"But perhaps if they see that the judiciary will give them their rights, they will come forward now if they hear about this case," Khalil said.
The trial, which ended Monday, was the first in Iraq to specifically address the Islamic State's crimes against the Yazidis — or at least one militant's crimes. It was also the first in which a Yazidi victim personally confronted her attacker.
The international human rights community has criticized the Iraqi judiciary for holding rapid-fire trials against large numbers of Islamic State members without detailing their individual crimes. "A vague charge of terrorism just does not do justice to the act committed," said Belkis Wille, the senior Iraq researcher for Human Rights Watch.
Wille said this prosecution appeared different.
"This would be the first case I have come across in the last four years where a victim has had any meaningful role in the proceedings," she said. "And it would be first case where the charge of rape was added and addressed by the court, which is significant."
She explained that the rape charge seemed to show that the Iraqi judiciary recognised how important it is for individual Islamic State victims to have their day in court.
Haji Hamid grew up in Khana Sor, a small town in the Sinjar mountain region of northern Iraq near the Syrian border, which is entirely populated by people of the Yazidi faith. She had six sisters and 12 brothers; her father had two wives.
"We had a stable life there," she told the court. "I was happy with being with all my cousins."
Then armed members of the Islamic State rolled into town on August 3, 2014.
"They told us we were infidels and that our sect needed to become Islamic," Haji Hamid testified. The Yazidi religion is shaped by a variety of faiths, including Zoroastrianism, Islam and Judeo-Christian practices.
Her father declared that they were committed to their faith.
The militants gave him a day to decide whether to convert. After that, they warned, those who did not would be "slaughtered, except for the women," Haji Hamid said.
The family resolved to escape by night and loaded up their cars. More than 70 of them piled in, but before they could leave, a group of Islamic State members intercepted them. They separated men from women, and then young girls from their mothers.
Haji Hamid was with a group of nine girls who were sold to Islamic State fighters for "$100 or $200," she said. "Four of my sisters were sold in Syria, and me and my younger sister were sold in Nineveh province in Iraq," she said.
Later, she was held in a place with about 50 girls.
"We were forced to change our clothes," she said, "and they kept us almost naked, like dancers, and they told us to do prayers in the Islamic way five times a day."
Eventually, Haji Hamid was given to Sahab, who at the time was about 30, and had escaped from prison with the help of the Islamic State.
In court on Monday, the judge asked if she recognised her captor in the room, where he was now wearing prison yellow.
Haji Hamid looked at the defendant directly and nodded.
"I know him better than I know myself," she said.
She said it was just one day after she was given to Sahab that he "forcibly raped me." At the time, she said, she was a virgin.
He asked her to marry him, and when she refused, he went to an Islamic judge and had a ceremony anyway. Under Iraqi law, marital rape does not exist.
"He raped me every day, sometimes two or three times a day," Haji Hamid said.
The only reason she did not become pregnant, she said, was because she got her captor to take her to the doctor on the pretext that she was ill. When she was alone with the doctor, she begged for birth control pills, and then took them secretly, she said.
During her captivity, Haji Hamid testified, she tried to cut herself with the idea of committing suicide.
Finally, she went to the doctor and asked for sleeping pills, saying she needed them to get some rest. Instead, Haji Hamid and the other Yazidi girls prepared a meal for the Islamic State fighters, and put the sleeping pills into their food.
While the fighters were sleeping, the young women escaped to Sinjar mountain.
When the Islamic State took control of northern Iraq in 2014, it singled out Shiites and Yazidis for the worst treatment, killing or enslaving many and sending the Yazidis fleeing from their homes around Sinjar. Many of the atrocities came to light after the Iraqi army, backed by the US forces, retook the north.
Sahab is originally from Anbar province, an overwhelmingly Sunni area of western Iraq. When he was 19, he killed a taxi driver and stole his car, and was sentenced to 20 years in prison. When Islamic State broke into the prison, freeing the prisoners, Sahab quickly swore allegiance to the group.
At his trial, Sahab expressed neither regret nor a sense that he had done anything wrong.
In court, he described himself as "a Quran teacher," and said, "I also did spiritual things like driving demons out of people."
Sahab said that he had been told by the Islamic State leadership to participate in the attack on the Yazidis, and that he had been injured, spending a few weeks in the hospital.
"They came to me and said they had a captive, a sabiha, for me," he testified. He said, "She was given to me as a gift."
Sahab insisted he could not tell if his "gift" had been happy or unhappy. "I did not see her crying or laughing," he said.
Although Haji Hamid is now back with her family, not all of her brothers and sisters were able to do the same.
"My father bought five of my sisters from Daesh," she said. "He paid $15,000. They were all forcibly raped many times."
"We have them all back except Reham — we do not know her destiny," she said.
Then she paused: "And five of my brothers went with Daesh, and they are lost."
Written by: Alissa J. Rubin
© 2020 THE NEW YORK TIMES