It’s not always easy to give fans a series finale that’s equal parts satisfying and enjoyable, but “Homeland” seems to have pulled it off.

The tense and gritty Showtime spy drama wrapped up its eight-season run on Sunday, with a twisting, complex grande finale that surprised fans by ending on a more positive note than many anticipated.

In an effort to avert nuclear war, Carrie Mathison (Claire Danes) betrays her longtime mentor Saul Berenson (Mandy Patinkin), turning him over to a Russian kill team when he refuses to disclose the identity of his double-crossing asset within the Russian intelligence community.

However, instead of Saul getting shot or tortured, Carrie manages to discover Saul’s double-agent, who turns out to be a Russian U.N. translator. The translator kills herself before she can be captured, but it’s enough for the Russian spies to release vital information that prevents a nuclear war.

Her efforts, however, get her branded a traitor to the US, and the show flash-forwards two years to show Carrie living in Moscow with a Russian spy, and having published a book about her decision to betray America.

However, we see a special copy get into Saul’s hands, and it contains a message from Carrie about Russian secrets, proving she’s now working for America from inside the seemingly impenetrable fortress of Russian secret intelligence, and she’s now Saul’s new asset.

“Well done @SHO_Homeland 👏👏👏 BRAVO! THAT is how you end a series. Just fantastic,” wrote one Twitter user, while another added, “Congrats to #Homeland  for being the only show to get a series finale right.”

“What a BRILLIANT ending. Never been so satisfied or impressed with a series finale,” another fan wrote, while one viewer gave special shout outs to Danes and Patinkin for “leading one of the most brilliant shows on television.”

Homelandreturned for its eighth season after a two-year break, and Danes addressed the show’s conclusion at the winter Television Critics Association press tour back in January.

“It’s taxing and humbling, but I’ve been with this imagined person. I’ve been carrying her with me for almost a decade,” Danes said of playing Mathison. “I’ve been in this incredible company that is just so exquisitely talented and I just know how rare that combination is — to be working with people I trust and admire so much and to always be working with material that always is challenging.”

“I feel very conflicted,” the actress confessed of the show ending. “This could continue… think of it like origami. I think it is providing a service that isn’t being provided readily. I don’t think that I agree that [Homeland] is just entertainment, there will be an absence. I will miss it personally. I think it will be missed.”