SPOILER ALERT: Do not read if you have not yet watched the series finale of “Nashville,” which aired July 26 on CMT.

The curtain has closed on musical melodrama “Nashville” — this time for good.

It was a wild, six-year ride for the series that originally premiered on ABC in 2012 but was canceled by the broadcaster four years later. Cabler CMT picked up the series just weeks later in 2016, staking a claim in scripted television. Over the years, the show saw births, deaths and scalds on-screen and showrunner changes and the exit of one of its stars (Connie Britton) behind-the-scenes. Of course the series finale had to go out in an equally big way, says executive producer Marshall Herskovitz, to match up to the “outrageous” saga it always was.

And what better way to do that than to see Britton, whose country music sensation character Rayna James died in the penultimate season, return?

“I knew that to end the show without her would have left a big hole in me, and I think it would have for a lot of fans, and I think, certainly, for the cast,” says creator Callie Khouri. “Everybody wanted her to come back.”

Each day since the saintly Rayna passed away from complications from injuries from a car crash in the show’s fifth season, fans have flooded Khouri’s and Herskovitz’s Twitter feeds with pleas for her return and ideas on how to work her back into the storyline. One of the most popular suggestions involved revealing her death — and everything that followed — to be a dream.

Instead, though, Rayna came to her widower Deacon (Charles Esten) in a memory from their wedding night, offering him words of comfort and love as he prepared to go on his first solo tour — a milestone Rayna always wished for him.

“It was so exciting,” Khouri says of Britton’s return to the set. “Everybody was just kind of giddy having her there. It was so beautiful to see her and Chip [Esten] get to do a final scene together.”

While Herskovitz says Britton’s comeback was “one of the first conversations” the “Nashville” team had when the end date was in sight, scheduling wasn’t easy. Britton had to cut a mother-son spring break trip to Mexico short in order to fly out to Nashville, Tenn. for her two-day filming schedule. But the TV drama veteran was happy to do it.

“Rayna got to do the impossible,” Britton says. “She got to come back from the dead. I got to do the most wonderful, which was to go back to my ‘Nashville’ family and celebrate all the hard work and love and care that went into that show.”

Britton did make one more appearance before the final curtain call in a sing-along sequence that broke the fourth wall. As a final sign off, Britton, Khouri, and nearly every person on the cast and crew — past and present — joined Esten onstage at the Ryman Auditorium to sing the fan-favorite “A Life That’s Good” and thank all of the fans who hung on until the very end.

“Being on the Ryman stage, reunited with six years of cast and crew, is a moment I’ll cherish and never forget,” Britton says. “I am grateful.”

The Ryman Auditorium houses many fond memories for the “Nashville” cast and crew, both as a set and as a local hangout. Often called “the mother church of country music,” the Ryman was woven into the fabric of the show, as well as the city on which it’s based.

“To be able to shoot the last scene on the last day of shooting at the Ryman — it just felt like some kind of magical thing happening for us,” Khouri says. “It was absolutely real righteous closure.”

But several diegetic water cooler scenes led up to Britton’s reveal and the farewell address to the TV audience. For example, up-and-coming artist Alannah (Rainee Blake) had a #MeToo moment. When the nefarious music mogul Brad (Jeffrey Nordling) invited Alannah up to his hotel room for what he described as a party, she instead arrived at his room to find him alone, expecting her to fulfill an “implicit contract.”

When Brad tried to force himself on her, Alannah pushed him off and made for the door as a gesture to terminate their collaboration. But Brad wouldn’t let Alannah leave before he threatened her, saying she’ll “never work again” in a sequence that played out like a Harvey Weinstein expose.

“It was certainly influenced — but not inspired by that,” Herskovitz says. “When that script was written, of course all that stuff was in the public consciousness, so we had to refer to it, or else it would have been very odd.”

The harassment plot ended in a final Time’s Up-esque moment, with Alannah, Jessie (Kaitlin Doubleday) and quite a few other of Brad’s female victims storming his platinum record-clad office with lawyer in-tow. When Brad tried the ever-villainous “you have no proof” trick, Alannah played a recording of their hotel room confrontation on her phone.

“What he was doing to Alannah was particularly cruel because he was smart enough to understand that if he behaved more overtly, she could get him on a harassment claim,” Herskovitz says. “He was very careful in his approach and had plausible deniability most of the way. She came to realize that he had her under contract. He was punishing her. Nothing was gonna happen in her career. She had to take matters in her own hands to get herself out.”

Also included in the anti-Brad army was Deacon who, in the fourth season, rescued his teenage daughter Maddie (Lennon Stella) from a similarly abusive situation with a music executive that had previously sexually assaulted her mother, Rayna. For Khouri, including predatory male figures was a no-brainer in a show about the music industry, which often forces women to make “the choice between half-prostitute just to follow our dream.”

“It’s always been a part of the music business,” Khouri says. “It’s just woven all the way through it. Get any female artist … and you’ll hear it. I felt like it was really important to show how it happens — that it’s still happening.

The finale also wrapped up some of the show’s longstanding on-and-off relationships with happy endings. After years of passionate sex, harsh breakups, screaming matches and tears, Avery (Jonathan Jackson) and Juliette (Hayden Panettiere) decided to try to make it work again.

A newly mature and pregnant Juliette offered Avery an out, retiring from show business and moving away to a quiet home in the country. Avery decided to join her, her daughter Cadence and child-on-the way in a loving reunion scene outside Juliette’s new cottage.

“We started them out as the two most narcissistic, awful characters,” says Khouri, referring to Avery and Juliette. “To bring them around to two mature people — I guess maybe it’s my wish fulfillment that you work out a lot of the bugs and you can get yourself to a good place where you’re a decent, loving, caring human being who can see the world in terms of other than just yourself.”

“He doesn’t come back to her because he has to or because she can’t live without him,” Herskovitz adds. “He’s coming back because he chooses to. I think that’s what makes it satisfying.”

Another family reunion occurred between Deacon and his father (Ronny Cox), who Deacon has spent much of season 6 trying to accept back into his life despite blaming his abusive parenting for his alcoholism. Deacon swore to sever ties with his dad once and for all when his stepdaughter Daphne (Maisy Stella) discovered her step-grandfather had been hiding alcohol. But at the request of his daughters and on his father’s word that he hadn’t touched a drink since the confrontation with Daphne, Deacon finally decided to let his father back into his life by inviting him to join him on the Ryman stage.

“It was a huge turning point for him to be able to stop fighting his past and stop fighting that same battle that he’d been fighting his whole life,” Khouri says. “I felt it was like what Rayna would have wanted him to do.”

For Herskovitz, that kind of unconditional love has always been a crucial part of the show, which has featured countless complex relationships, made especially strained by Nashville’s pressure of production.

“To be moved by the power of love and the power of creativity,” Herskovitz says. “Both of those things are very difficult, and I think what you watched over the six years is how these characters found a way to do both.”

Cultivating human connections was essential to Herskovitz when he and his partner Ed Zwick took over the show for CMT. Fearing the show had strayed too far toward “soap opera” by the end of season 4, the pair set out with the goal of bringing the drama more inward — a goal Herskovitz believes they achieved.

“We followed our instinct to move the balance more toward the side of human relationships and deep connections between people and the conflicts that arise from that, and pull back a little bit on the outrageous events,” Herskovitz says. “But mind you, plenty of outrageous events still happened.”

Each day on the show after day one has been a dream come true for Khouri, who admits she had very little faith in the series when she created it.

“When we started, I was so skeptical,” Khouri says. “I was like, ‘They’re never gonna make a show about Nashville. That’s not gonna happen.’ And then everybody would be so excited, and I’d go, ‘Yeah, well it’s not gonna get picked up.’”

But six years later, with one unexpected cancellation already behind her, Khouri has been grateful for the chance to finish the series on her own terms — though the characters will live on in her mind forever.

“When we got to the end, and we realized season 6 was gonna be our last, we started really appreciating the time that we had,” Khouri says. “Did I get to do every single thing I wanted to do? No. But am I satisfied? Yes, I am.”