It sounds like something from a terrible TV sitcom: Convicted murderer moves in with filmmaker. But here we are.

Bernie Tiede, the former East Texas mortician whose 1996 killing of a rich widow inspired Austin filmmaker Richard Linklater’s 2012 dark comedy, “Bernie,” is free on bond, after the district attorney who prosecuted him agreed Tuesday to let him out of a life sentence.

Linklater testified Tuesday on Tiede’s behalf in a court hearing in Carthage and offered to house Tiede in an Austin garage apartment he would provide.

Visiting Panola County Judge Diane DeVasto agreed to let Tiede live with Linklater, recommended a reduction in Tiede’s sentence and set bond at $10,000 Tuesday. Jail records show Tiede was released on bond Tuesday afternoon.

Tiede, 55, was convicted in 1999 in the shooting death of 81-year-old Marjorie Nugent in Carthage, near the Louisiana state line.

Panola County District Attorney Danny Buck Davidson, who originally prosecuted Tiede, agreed with Tiede’s appeals attorney, Jodi Cole, that Tiede deserved a lighter sentence because he was sexually assaulted as a child and also had an abusive relationship with Nugent.

Tiede must seek counseling for the sexual abuse and he is not allowed to possess firearms. The Texas Court of Criminal Appeals must sign off on the sentence reduction while Tiede is out on bond.

Davidson, who said he believes residents’ opinions of Tiede have changed “180 degrees,” called Tiede’s release “bittersweet.” He said he had a duty, however, to act once it was clear other factors had led Tiede to kill.

Linklater’s 2012 film, which starred Jack Black as Tiede, Shirley MacLaine as Nugent and Matthew McConaughey as Davidson, was based on Skip Hollandsworth’s 1998 Texas Monthly article on the murder.

It was a deeply strange case. The soft-spoken Tiede was well-liked in Carthage. Nugent, who had made Tiede her sole heir, was very much not.

Tiede met Nugent in 1990 at the funeral of her husband R.L. “Rod” Nugent, who had made his fortune in oil and banking. The two grew close, taking trips around the world. Nugent signed a will leaving her estimated $10 million fortune to Tiede.

Tiede was 38 years old in November 1996 when he shot Nugent in the back four times with a .22-caliber rifle.

Tiede then became known around town for his generosity. Townspeople have said he started scholarships, pledged money to a church building campaign and ran a fundraising drive for Boy Scouts. He also gave away large gifts, including several cars.

Her corpse was found nine months later in a freezer at her Carthage home, wrapped in a sheet lying among packages of frozen corn, pecans and meat. Tiede admitted to the murder to police in August 1997.

Much of Carthage supported Tiede and was saddened by the 1999 conviction. It was a scenario tailor-made for Linklater, who c0-wrote the film with Hollandsworth.

“I knew Bernie and this town. I just knew this world so well,” Linklater, who went to high school in Huntsville, told the American-Statesman in 2012. “It stayed with me. It’s kind of incumbent on storytellers, in a general sense, to tell stories from their area. It’s something they know. So it’s in that tradition that I enjoy creating bigger-than-life characters. Because that’s what we have around here.”

Texas Monthly reported that Tiede’s new attorney, Cole, became interested in the case after seeing the movie at a Texas Monthly-sponsored screening in Austin. She approached Linklater about re-examining the case. After becoming Tiede’s lawyer, she discovered evidence of sexual abuse, which was a factor in Tiede’s early release.

Psychiatrist Edward Gripon of Beaumont testified Tuesday that he does not believe Tiede committed premeditated murder. After talking with Tiede in January, Gripon said he believed Tiede had a dissociation episode stemming from being sexually assaulted as a child. That information was not presented in the original trial and could have been used in the sentencing phase for a maximum 20-year sentence.

Linklater could not be reached for comment Tuesday.