Former cop Amber Guyger was “distracted” by an “intimate” phone call with her partner, with whom she was having an affair, when she fatally shot her unarmed black neighbor in his Dallas apartment, Texas prosecutors alleged in court Monday.

The 31-year-old white woman is on trial for the Sept. 6, 2018, murder of 26-year-old Botham Jean. In the wake of the shooting, Guyger claimed that she had confused his apartment for her own and believed he was an intruder. The case prompted mass protests in Dallas against racial bias and excessive use of force by police. If convicted, Guyger faces up to 99 years in prison.

“Prior to that conversation Amber Guyger was able to effectively do her job,” Assistant District Attorney Jason Hermus said during his opening statements at the Frank Crowley Courts Building in Dallas Monday.

He added that the call ended a mere three minutes before Jean was fatally shot. “Amber Guyger made a series of unreasonable errors and unreasonable decisions and unreasonable choices,” Hermus alleged.

Guyger arrived in court with a security detail, passing by several protesters and Dallas faith leaders who were holding a prayer vigil outside, according to court reporters. The Botham family waited inside the courtroom all morning as the two legal teams and the judge ironed out the last pre-trial motions.

Throughout the highly anticipated two-week trial, the sequestered jury will decide whether Guyger’s actions amount to a crime or a tragic accident. While prosecutors argued that Guyger was “distracted” by her affair with her partner, missing all the signs that suggested she was in the wrong apartment, the defense claimed Monday that the off-duty cop was simply “exhausted” after a long day’s work.

“Amber Guyger reasonably believed she was in her apartment... that she had no choice but to use her gun to keep from dying," Robert Rogers, her attorney, said in his opening statements, before slamming the prosecution for “twisting and turning innocent mistakes into evil acts.”

On Sept. 6, Guyger returned to her apartment building at about 10 p.m. after working a 13-hour shift. She’d just gotten off the phone with Martin Rivera, her police partner with whom she was in an “intimate” relationship, prosecutors alleged.

Believing she was on the third floor, the five-year veteran was allegedly so distracted by the phone call that she didn’t notice walking up to Jean’s fourth-floor apartment—despite his bright red doormat.

“Amber Guyger has no floor mat in front of her door,” Hermus said. “Botham Jean wanted his apartment to be very noticeable. In front of his front door is this extremely obvious bright red floor mat.”

When she opened the door, which was slightly ajar, Guyger noticed a “large silhouette” and believed it to be a trespasser, she told police.

Jean, an accountant at PricewaterhouseCoopers who lived alone, was inside watching TV and eating a bowl of vanilla ice-cream when he heard the door open, Hermus said. As he got up from the couch, Guyger immediately drew her gun and gave him verbal commands.

Guyger fired two shots when Jean did not respond, hitting him once in the chest, the arrest warrant affidavit said.

“The effect of this bullet is catastrophic,” Hermus said, adding the other bullet hit the back wall of his apartment.

The off-duty cop then called 911 instead of giving Jean medical aid, Hermus added. Guyger has claimed that it was not until she turned on the lights and emergency dispatchers asked for her address that she realized she was in the wrong apartment unit.

“I thought it was my apartment,” Guyger told dispatchers 19 times on the 911 call played in court Monday. “I thought it was my apartment. I’m fucked. Oh my God. I’m sorry.”

Prosecutors told jurors Monday that they will see Guyger’s text messages and call log from that night, to prove she had a “date” planned with Rivera that evening. Several text messages also show the two were sending “sexually explicit photos,” prosecutors said.

After the attack, she continued to text Rivera, which prosecutors believe shows the 31-year-old was also only concerned about her own well-being after the shooting.

“She should’ve made it her point of existence to take care of that man,” Hermus said, adding that while Guyger was still on the phone with emergency dispatchers, she texted Rivera: “Hurry I need you. I fucked up.”

Defense attorneys, however, argued Monday the accident was “a perfect storm of innocent circumstances,” and Guyger “firmly” believed she was in a dangerous situation inside her own apartment.

Rogers admitted that Guyger and Rivera, who is expected to testify at trial, had a “romantic relationship,” but that it never impacted her work and ended in 2017. Around the time of the incident, Guyger had taken an extra job at a downtown church, and was having difficulty sleeping and staying alert.

“I’m sweepy,” she allegedly texted Rivera before heading home, according to Rogers. The defense lawyer added there is no evidence that proves the two had plans to meet later that night, as Guyger had taken the next day off to rest.

“Everything was behind her and she went on autopilot,” Rogers said, later adding Guyger will be taking the stand in her own defense. “You’ll hear from Amber. You’ll get to know Amber.”

Guyger was arrested for manslaughter three days after the shooting. As Jean was buried in a cemetery by the sea in his native St. Lucia on Sept. 24, Dallas Police Chief U. Reneé Hall fired Guyger.

In December, a Dallas County grand jury indicted Guyger on one count of murder after then-Dallas County District Attorney Faith Johnson presented the manslaughter case. Johnson told reporters at the time the decision meant the grand jury felt the cop’s actions were “knowing” and intentional.

Botham’s mother, Allison, also filed a federal lawsuit against the city of Dallas and Guyger last October, alleging the former officer used excessive force during the incident.