Melinda Wilson, who rescued her future husband, the Beach Boys co-founder Brian Wilson, from psychological ruin when they were dating in the 1980s, died on Tuesday. She was 77.

Mr. Wilson confirmed her death on Instagram, saying that they had been married for 28 years. No cause of death was given.

Jean Sievers, Mr. Wilson’s manager, said that Ms. Wilson had died suddenly at her home in Beverly Hills, Calif. She added that the couple has five adopted children — Dakota Rose, Daria Rose, Dash, Dylan and Delanie Rae — who all survive her and carry Mr. Wilson’s surname.

The couple’s relationship was portrayed in the 2014 biopic “Love & Mercy.” The film shows Ms. Wilson (Elizabeth Banks) meeting Mr. Wilson, played by both John Cusack and Paul Dano, in a Cadillac showroom in Los Angeles where she was working as a saleswoman.

After the film was released, Ms. Banks said in an interview with ABC News that she had met Ms. Wilson while preparing for the role.

“She said to me, ‘Music is his first love,’” Ms. Banks told ABC. “‘Nothing can replace it. It’s his being, it’s his essence, it’s his everything. So I’m settling for second, but it’s a pretty good — it’s a pretty good second.’”

The film shows Ms. Wilson helping her then boyfriend navigate a bout of mental illness in the 1980s. That effort, and their courtship, is complicated by the presence of Eugene Landy (Paul Giamatti), a psychologist who had helped Mr. Wilson fight off depression and substance abuse to stage a professional comeback.

Mr. Landy, whose team of professional minders at one point lived with Mr. Wilson 24 hours a day, insinuated himself into the musician’s life to the point where the therapist was at one point acting as his Mr. Wilson’s business partner, record producer and occasional songwriting partner.

In 1992, a lawsuit by Mr. Wilson’s family resulted in a court order that barred Mr. Landy from contacting Mr. Wilson. Mr. Landy died in 2006.

Melinda Kae Ledbetter was born on Oct. 3, 1946, in Pueblo, Colo. She grew up in Whittier, Calif., and went to college there before becoming a model, Ms. Sievers said.

She also worked as a producer on several films related to her husband’s music, including “Brian Wilson: Long Promised Road” (2021) and “Pet Sounds Live at Royce Hall” (2006). The latter title refers to “Pet Sounds,” a landmark 1966 Beach Boys album.

When the couple saw the film “Love & Mercy” for the first time, Ms. Wilson told ABC News, she did not know how tough the experience would be.

“I think I was more nervous than him when I took him to see it, and after, I said, ‘So what did you think?’” she said. “And he goes, ‘Oh, it was really a lot worse in real life.’”