Prosecutors, on the first day of the trial, contend a former Dallas police officer accused of murdering a man who she wrongly believed was in her own apartment was distracted by sending sexually explicit text messages to her police force partner.

Attorneys for Amber Guyger, 31, argued that she fired in self-defense based on the mistaken belief that she was in 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 Martin Rivera, her police force 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.

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

Rogers also dismissed as “preposterous” the relevance to Jean’s death 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.

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.