A former Dallas police officer accused of fatally shooting a man whose apartment she mistook for her own sobbed under questioning at her murder trial Friday, but acknowledged that she sent text messages to her partner while she waited for paramedics and officers to arrive.

The trial of Amber Guyger, 31, was halted twice to allow her time to compose herself.

Guyger is accused of shooting and killing 26-year-old Botham Jean inside what she thought was her third-floor Dallas apartment.

Guyger, who claimed self-defense in the shooting, was fired by Dallas police after the incident.

On the night of the shooting, Guyger, returning home after 13 hours on duty, had parked on the fourth floor of her apartment complex, instead of the third, and walked through an entryway that was identical to her own.

Jean, a native of the Caribbean nation of St. Lucia who worked as an accountant in Dallas, had returned to his apartment only a half-hour before the shooting after running an errand.

Guyger was able to enter Jean's apartment because of a defective lock and latch that gave way as she put her key in the door. Seconds later, she spotted Jean inside.

Although she claims he lunged at her as she shouted at him to show his hands, prosecutors said Jean was instead in his living room eating a bowl of ice cream when she entered his apartment.

Guyger fired twice, hitting him once in the chest.

The defense, in an attempt to explain why the bullet that killed Jean took a downward angle through his body, argues that the victim likely crouched down moments before the shooting.

A sobbing Guyger, under questioning by her attorney, expressed remorse for the killing, saying, "I feel like at terrible person, I feel like a piece of crap" because of the shooting.

"I wish he was the one with the gun and he killed me," Guyger said. "I never wanted to take an innocent person's life."

In her testimony, Guyger acknowledged that after calling 911 she continued to text her police partner, with whom she was having an affair, while she waited for paramedics and officers to arrive.

It was unclear to what extent Guyger, as she claimed, tried to help Jean as he lay mortally wounded on the floor. Under questioning, she acknowledged that her uniform was clean of blood.

Background:Dallas officer who fatally shot unarmed black man told 911: 'I thought it was my apartment'

The former officer testified that she had felt threatened by the person she thought was an intruder in her own apartment.

"I was scared, I thought this person was going to hurt me, and I am so sorry," she said.

At another point, she told the jury "I was panicking."

In the cross examination, Guyger also acknowledged that after spotting Jean in the apartment, she could have retreated and radioed for help from a police station only two blocks away.

The prosecutors also challenged her contention that she shouted at the victim to show his hands, saying no neighbors could recall hearing any such loud commands.

Contributing: The Associated Press