The wife of a San Diego-based sailor who was killed inside his El Cajon apartment in March testified Tuesday that she had been dating the man accused of murdering her husband.

Michelle Tsethlikai, a Navy veteran who left active duty service in February, told the judge that she and Boatswain’s Mate 3rd Class Dylan Poston were together in Tsethlikai’s apartment on March 6 when her husband, Operations Specialist 2nd Class Anderson Lopes, unexpectedly came home early from working a night shift and found them together in bed.

The incensed husband allegedly stormed into the bedroom and punched Poston multiple times before demanding that he leave the couple’s apartment.

When Poston, a 26-year-old Alaska native, went downstairs to gather his belongings, an ensuing argument erupted upstairs between Lopes, 24, and his wife, escalating to the point of Lopes allegedly attempting to shove Tsethlikai down the stairs two different times, according to a testimony given by Tsethlikai during Tuesday’s preliminary hearing in San Diego.

Lopes, who Tsethlikai was in the process of divorcing, had a history of domestic violence, she told the judge.

The argument between husband and wife quickly spilled downstairs, pitting the three in the same room once again. Lopes again demanded that Poston leave the apartment.

Poston, who reportedly knew about Lopes' alleged pattern of abuse, agreed to leave but told the couple he first wanted to be sure Lopes wasn’t going to hit Tsethlikai, Poston’s defense attorney David Shapiro told Navy Times.

The husband responded by leaving the room for a few moments before returning and brandishing a 14-inch metal pipe, according to Tsethlikai’s testimony, which he allegedly then swung at Poston.

Poston blocked the pipe attack, his defense said, and a subsequent struggle ensued between the two men. At some point during the fray, Poston took out a small knife with a three- or four-inch blade, an action his defense claims was in self-defense or in defense of Tsethlikai.

By the time Lopes conceded the fight, he had suffered five stab wounds and eight lacerations to his body, according to testimony from the medical examiner.

“This homicide, we believe, was justifiable based on the defense of himself and his girlfriend," defense attorney David Shapiro told Navy Times.

Tsethlikai called 911 when she realized her husband was not breathing, NBC San Diego reported. She had also been stabbed in her thigh during the melee.

Paramedics from Lakeside Fire Department treated the couple and took them to a nearby hospital, where Lopes was later pronounced dead.

Poston was arrested on scene and charged with one count of murder, a charge that was upheld during Tuesday’s hearing. His bail, however, was reduced from $3 million to $300,000.

“While we are disappointed in the ruling holding Mr. Poston to answer to the murder charge, we are encouraged by the state of the evidence which came out during today’s hearing as we believe it reaffirms the strength of Mr. Poston’s self-defense claim,” said Shapiro.

Poston’s next court appearance is scheduled for Sept. 5, when he is expected to enter a plea of not guilty. A judge will then determine whether the evidence against Poston warrants a trial.

Lopes, a New York native, enlisted in the Navy in August 2013. He spent time aboard the Whidbey Island-class dock landing ship Ashland before arriving at his most recent command, the Arleigh Burke-class destroyer Howard, in February 2017.

Poston and Tsethlikai, who enlisted in 2013 and 2014, respectively, were both assigned to the guided missile destroyer Stockdale.