As armed and masked men entered her luxury suite at a Paris hotel in 2016, Kim Kardashian thought it was the end.
"I absolutely thought that I was going to die," the reality TV star and entrepreneur said Tuesday in a courtroom in Paris, where a trial is underway for 10 people accused in connection with the violent robbery of her pricey jewelry.
The 44-year-old Kardashian was testifying to give her version of the events, where she said she was tied up and held at gunpoint during Paris fashion week in 2016.
Nine men and one woman are accused in connection with the robbery, during which five masked men posing as police officers allegedly stormed into Kardashian's hotel suite.
The suspects allegedly made off with valuables worth at least $6 million, including a diamond engagement ring given to Kardashian by her then-husband Kanye West. That ring alone was said to be worth about $4 million.
Kardashian, in sometimes-tearful testimony, recalled the night, saying she was packing at about 3 a.m. when "two men came into my room -- they were dressed as police officers." The men were leading the hotel's concierge, who was handcuffed, Kardashian told the court.
She said her first response was, "What's happening? What's happening?" That confusion soon turned to terror, she said, as both men turned their guns on her -- one pointed at her back, the other at her neck. Soon, one of the men began gesturing toward her hand, repeatedly saying, "Ring, ring."
Kardashian testified that she initially thought it might be a terrorist attack.
Kardashian told the judge she was tied up, gagged and thrown into a bathroom. She recalled thinking of her sister Kourtney, praying that she wouldn't find Kourtney dead in her bed. She thought then that "she would have this memory forever."
When Judge David De Pas asked if she thought she would die, she replied, "I absolutely thought that I was going to die."
De Pas also asked Kardashian if she was assaulted during the ordeal.
Kardashian answered that she was not assaulted, but added that she was "grabbed and dragged into the other room and thrown on the floor."
She also confirmed to the judge that a weapon "was pointed towards me to get me from one room to another, and then again it was pointed to me when I was on my bed at the end."
"I kept telling them that I have babies, and that I needed to go home to my babies," Kardashian testified.
Kardashian recalled one of the robbers telling her "to shut up" when she asked if she was going to be killed.
During the early part of her testimony, Kardashian said that while she was still tied up in the bathroom, she managed to scoot over to the sink and get her hands free. With her feet still tied, she said she hopped downstairs, where her friend, Simone Harouche, helped untie her.
At one point, the judge asked Kardashian to describe the masked robbers.
Kardashian said that she has tried to remember the color of their eyes, but she could not, saying, "You start thinking about your family and then it all goes out the door."
She said she was surprised when the French magistrate showed her pictures of the suspects, who have collectively been referred to as the "grandpa robber" -- or "papys braqueurs" -- because many of them are over the age of 60.
"I thought that these people were younger," Kardashian said.
Kardashian testified that she believed the robbery was planned, and that she might have been targeted on a previous trip to Paris she took with West.
"At that time, I was with my ex-husband. They didn’t succeed," she said without elaborating. "It is a shock to imagine that this type of operation can be prepared in advance."
MORE: Driver Among 17 Arrested in Connection With Kim Kardashian West RobberyKardashian also testified that it was a last-minute decision to stay at her suite the night of the robbery instead of going out to a club with her sister.
She added that in addition to her jewelry, the robbers stole around $1,000 in cash.
“I didn’t give it to them. I think they found it in my wallet," Kardashian said.
Kardashian expressed surprise upon learning in court that one of the alleged robbers, Ait Omar Khaddache, wrote an apology letter to her in 2017.
Looking directly at Khaddache, who is now deaf and mute, Kardashian said, "It is very moving to receive these words. I appreciate the words of this letter. Especially that I work in the justice field and I believe in rehabilitation. I would like to become a lawyer. I believe in giving a second chance."
Kardashian, still staring at Khaddache, said her hope is to "give voice to the victims in order for them to be understood."
"I forgive you for the acts that you committed. I do not forget the traumas I lived," Kardashian said.
Kardashian said she endured painful attacks from people alleging she had staged the robbery for her reality TV show.
"It was really hurtful; that [was] really something that stung deeply," Kardashian testified.
She said she felt relief when, in January 2017, French authorities announced the arrests of the robbery suspects.
"I was saying to myself, 'Finally they will believe me,'" Kardashian said.
Kardashian said she was "shocked" to learn that one of the suspects had written a book about the robbery, titled "I Sequestered Kim Kardashian."
She said she believed the heist was not just about making money, adding that the robbers had profited from memories such as a watch her father, Robert Kardashian, who died in 2003, gave her as a high school graduation present.
"It did change my life," she said of the robbery. "I am in therapy. I have children. I have to raise them. It did impact my life and involved drastic changes."
Kardashian said she remains haunted by the event, saying, "Bad memories are coming back when I hear someone taking the stairs."
"Now security is reinforced at home. It's something necessary to sleep at night. We have security in all the rooms," Kardashian said.
MORE: Video Kim Kardashian Finally Addresses Robbery at GunpointShe said she has also taken other precautions, including not posting about her activities in real time on social media.
Wrapping up her testimony on Tuesday afternoon, Kardashian was asked by lawyers about the calm demeanor exhibited by the hotel's concierge, Abderrahamane Ouatiki, during the robbery. She said she does not believe he was involved in the robbery, adding, "He was with me, not against me."
"I do believe he is a victim," said Kardashian, adding, "Staying calm saved his life."
The trial, which began last month, has been a spectacle in the French media. The defendants are charged with several counts, including armed robbery in an organized gang. Some are also charged with kidnapping.
There were initially 12 defendants in this case, one of whom has since died. Another person cannot be tried due to their medical condition, according to French authorities.
Kardashian's testimony followed that of Harouche, a stylist and friend, who earlier on Tuesday told the court about the shock and trauma of waking up during the robbery.
MORE: Kim Kardashian West Looking at Life 'Differently' After RobberyHarouche described the scene, saying she saw Kardashian coming down the hotel suite's stairs with tape on her feet. She said Kardashian was screaming that the pair may have to jump out the window to escape the burglars. Harouche said she could hear "terror" in Kardashian's voice.
"It was a sound I never heard from Kim," Harouche told the court. "It was terror. I remember specifically she said, 'I have babies and I need to live. Take everything. I need to live.'"
Kardashian "has tremendous appreciation and admiration for the French judicial system and has been treated with great respect by the French authorities," Michael Rhodes, an American lawyer representing Kardashian, said in a statement prior to the trial.
Rhodes added, "She wishes for the trial to proceed in an orderly fashion in accordance with French law and with respect for all parties to the case."
ABC News' Joe Simonetti, Will Gretsky and Hugo Leenhardt contributed to this report.