On the first day of trial, prosecutors contended a former Dallas police officer accused of murdering a man whom she wrongly believed to be in her apartment was distracted by sending sexually explicit text messages.

Attorneys for Amber Guyger, 31, argued that she fired in self-defense based on the mistaken belief that she was entering her own apartment and that Botham Jean was a burglar.

Jean, a 26-year-old accountant from the Caribbean nation of St. Lucia, “was doing no harm to anyone, which was his way,” Dallas County Assistant District Attorney Jason Hermus said in an opening statement. Jean was in his living room eating a bowl of vanilla ice cream on Sept. 6, 2018, when Guyger entered the apartment, which was one floor directly above her apartment, Hermus said.

Fox 4 reported that Guyger allegedly was distracted by texting Martin Rivera, her police partner.

Prosecutors questioned Rivera extensively about a 16-minute phone conversation he had with Guyger as she headed to her apartment that night in September 2018. Asked what it was about, he said he believes it was mostly about police work but his memory of the call was hazy. Again, however, he denied that it involved plans to see Guyger later that evening.

In his opening statement, defense attorney Robert Rogers dismissed the prosecution arguments.

GAMER SENTENCED TO PRISON IN DEADLY 'SWATTING' CASE

Guyger “was on autopilot,” he said of her entrance to Jean’s apartment. “She had tunnel vision.”

Rogers also dismissed as “preposterous” the relevance of Guyger’s sexual relationship with her partner.

Guyger was off duty but still in uniform when she shot Jean. She told investigators that after a 15-hour shift she parked on the fourth floor of the complex’s garage – rather than the third floor, where she lived – and found the apartment’s door ajar.

CLICK HERE TO GET THE FOX NEWS APP

Three days after the shooting, Guyger was arrested for manslaughter. She was subsequently fired from the Dallas Police Department and charged by a grand jury.

The jury will have to decide whether Guyger committed murder, a lesser offense such as manslaughter or criminally negligent homicide, or no crime at all.

Click for more from Fox 4.