Before she was murdered, Morgan Freeman’s step-granddaughter told her boyfriend-turned-killer that the actor had been secretly sleeping with her — confirming years-old claims about the illicit affair, according to defense lawyers.

“E’Dena Hines disclosed to Lamar Davenport and others that her grandfather engaged in a sexually inappropriate relationship with her,” Davenport’s lawyer, Beth Unger, claimed in court Friday.

His defense team didn’t go into further detail, but they provided testimony from a therapist who claimed that Davenport admitted to often arguing with Hines about infidelity — with each accusing the other of being unfaithful.

“Lamar admitted to me that they had a violent relationship,” said Dr. Jeremy Colley. “[Their] disagreements could be emotionally intense.”

Rumors about Freeman’s alleged affair with Hines have swirled since 2009, which is when it was first reported by The National Enquirer. Gossip sites later claimed that the relationship was serious — and that the two were even planning on tying the knot.

While they aren’t related by blood, Freeman has known Hines since she was a small child and has been a part of her life for years.

The 80-year-old adopted her biological mother, Deena Adair, during his first marriage to Jeanette Adair-Bradshaw and then helped raise Hines with his second wife, Myrna Colley-Lee. Adair was Jeanette’s daughter.

Freeman and Hines have both said in the past that the claims about them sleeping together were completely false.

“The recent reports of any pending marriage or romantic relationship of me to anyone are defamatory fabrications from the tabloid media designed to sell papers,” Freeman said in a 2012 statement, as stories circulated about their alleged wedding plans.

In a separate statement, Hines wrote: “These stories about me and my grandfather are not only untrue, they are also hurtful to me and my family.”

The 33-year-old was murdered in 2015 — stabbed 25 times outside her Manhattan building — by her drug-induced boyfriend, according to prosecutors.

Davenport is on the hook for second-degree murder and is facing a maximum of 25 years to life in prison, if convicted. His lawyers are pursuing an insanity defense.

They claim that he wouldn’t have taken Hines’ life if it weren’t for the drugs he was on, one of them being PCP.

“Mr. Davenport did not possess the intent to kill Ms. Hines,” said Colley. “My opinion was that he lacked substantial capacity to appreciate the wrongfulness of his actions and know the nature and consequences of his conduct.”