The murder trial of ex-Dallas police officer Amber Guyger opened Monday with the revelation that she was in a sexual relationship with her partner on the city's police force — and questions as to whether she was distracted by a phone call with him in the minutes before fatally shooting her neighbor.

Guyger's defense attorneys aren't disputing that on the night of Sept. 6, 2018, she mistakenly entered the unit of Botham Jean, who lived one floor above her in the same Dallas apartment complex, and then opened fire, believing he was an intruder.

But prosecutors introduced the state's case by attempting to show that Guyger, 31, failed at every turn to prevent the deadly chain of events. Guyger was initially arrested on manslaughter charges, but a grand jury indicted her in November 2018 on a murder charge.

"At the moment of this shooting, it was an intentional and knowing offense," Dallas County District Attorney Faith Johnson said at the time of the indictment.

In a victory before the trial opened Monday, lead prosecutor Jason Hermus convinced state District Judge Tammy Kemp to permit Guyger's cellphone records, web searches and text messages from the night of the shooting into evidence.

In doing so, Hermus on Monday revealed that the texts showed that Guyger had been having a relationship with Martin Rivera, her partner on an elite crime response team with the Dallas Police Department, and that she was on the phone with him as she drove into the parking garage and just prior to shooting Jean before 10 p.m.

In addition, prosecutors said, Guyger sent Rivera a sexually suggestive Snapchat message during the night of the shooting that said, "Wanna touch?" and that they had plans to meet up that night.

During his opening statement, defense attorney Robert Rogers acknowledged that Guyger had thought of Rivera as "her rock," and that they began an intimate relationship that grew out of being co-workers and sharing a squad car.

Download the NBC News app for breaking news and politics

But Rogers denied Rivera had any actual plans to see Guyger that night, and that "the relationship was ramping down" because Guyger was looking for someone "more stable."

He told the jury not to believe that she was distracted that night, but rather was fatigued and acting on "autopilot."

"What was going through Amber's mind was that, 'I'm done with my day's work. I'm going home,'" Rogers said.

Guyger's mindset — and how she could have failed to notice she was at the wrong apartment — will be the focal point of this trial, which has become one of the most anticipated murder trials in Dallas in decades. The shooting involving Jean, an accountant originally from the Caribbean island of St. Lucia, has reignited conversations about racial bias, police use of force and concerns that law-abiding citizens are not safe even in their own homes.

Guyger is white and Jean was black. She was off duty but in uniform when she got inside his apartment and fired her service weapon twice. She later told investigators that she had confused his apartment for hers and believed he was a burglar when she saw a "large silhouette" in the darkness.

Guyger said she tried to use her electronic key fob to enter the apartment door, but that it pushed open.

Rogers told the jurors in his opening statement that the plate around the door to Jean's apartment was defectively installed, and that it doesn't always fully shut, which could explain how Guyger got inside.

Rogers also said a survey of residents of the apartment complex found that Guyger wasn't alone in her mistake: More than 90 tenants said they unintentionally parked on the wrong floor or went to the wrong apartment.

Part of the problem, Rogers said, is that there's no obvious floor numbers at the entrance to the apartment complex from the parking garage.

The defense team argued that Jean's death was a mistake — but one without criminal intent behind it.

Former Dallas police officer Amber Guyger, center, arrives for the first day of her murder trial in Dallas on Sept. 23, 2019. Tom Fox / Dallas Morning News via AP

A so-called mistake of fact defense is enshrined under Texas law and will hinge on convincing the jury that Guyger made a reasonable error when she believed she was killing an intruder in her own home and exercising her right of self-defense.

The courtroom on Monday was filled with loved ones of Jean, with family and other supporters spilling out into the hallway. Among those who testified on the first day of the trial was Jean's sister, Allisa Findley, who told the jury that he smoked marijuana in his apartment after he was diagnosed with attention deficit hyperactivity disorder.

Hermus said the smell of marijuana — among other sensory details — should have been a clue to Guyger that she was on a different floor and at the wrong apartment.

Botham Jean Harding University

During his opening statement, Hermus held up a red floor mat that Jean kept outside of his unit's front door and said Guyger's apartment did not have one.

"For her errors, for her omission, Botham paid the ultimate price," he added.

Jean was sitting at home in shorts and a T-shirt, watching television and eating a bowl of vanilla ice cream when Guyger entered his apartment, Hermus said.

According to him, one of the bullets came to rest halfway between Jean's stomach and his back, and its trajectory shows that he was either trying to sit up from the couch or was cowering when Guyger came upon him.

Hermus added that Guyger had moved into the building about two months prior to the shooting, but that during the walk from the parking garage to Jean's apartment, passing about 16 different units, some adorned by potted plants or other decorations, "she just keeps on going on, missing all these clues."

Guyger faces a maximum of life in prison if found guilty of murder. Jurors are being sequestered for the duration of the trial, which could last two weeks.