A Texas woman on trial for the grisly 2016 slaying of her nephew admitted that they were involved in a years-long secret affair, according to reports.

Andira Abdelaziz, 37, said during her testimony Tuesday that she stabbed Mohammed Abdelaziz in self-defense, alleging he threatened her life, mySanAntonio reported.

The 25-year-old nephew was the blood relative of the defendant’s husband, whom she married when she was 14 years old.

The defense claimed that the nephew verbally and physically abused her during their three-year relationship.

Before she stabbed him, he allegedly sent her a slew of aggressive text messages, according to her attorneys.

“[He was] calling her the most vile names that I think any person could call another person, describing what he’s going to do to her,” defense attorney Mike McCrum told the jury, according to mySanAntonio.

Andira — who pleaded not guilty — testified that her nephew visited her Northwest Bexar County home, where he banged on the windows then pummeled her, on Aug. 9, 2016.

Police responded to a call about a burglary at the home, but officers found the report to be unfounded and she insisted there was no longer an issue.

Soon after the officer left, Andira allegedly stabbed her nephew once in the back with a kitchen knife, news station KSAT reported. He bled to death in the driveway of her home.

Prosecutors argued that the aunt acted out of fear the relationship would be revealed and she would disgrace her family.

“He sent nasty, threatening texts, suggesting he was going to reveal the romantic relationship to family,” Prosecutor Clayton Haden said, according to mySanAntonio. “The defendant gave a statement. Not once in that statement does she mention that the victim touched her that day.”

If convicted, Andira faces up to life in prison.