Spoiler alert! The following contains plot details from the “Game of Thrones” series finale, Season 8 Episode 6, "The Iron Throne."

There's nothing like the anticipation, expectation and dread that surrounds the finale of a beloved TV series.

This year, two of television's biggest shows of all time – "Game of Thrones" and "The Big Bang Theory" – said goodbye in the same week. Both tried to satisfy in their final hours, but only "Big Bang" truly succeeded. Sometimes, no matter how much you love what came before, a series can miss on its last swing, leaving a bitter taste for years to come.

In honor of both series saying goodbye, we ranked the 10 best and five worst finales of all time, from golden classics ("M*A*S*H") to recent travesties ("How I Met Your Mother," and yes, "Thrones").

The best

1. "Six Feet Under" (HBO)

"Six Feet Under" was always about facing our own mortality (it was, after all, about a family-run funeral-home business), and the near-perfect finale faced the great beyond head-on in its excruciatingly beautiful last sequence, which flashed forward to the deaths of all the main characters – predictable, tragic or absurd. Every series finale that’s used the flash-forward technique owes a great debt to "Six Feet."

2. "Newhart" (CBS)

As twisty and self-referential as modern TV has gotten, no show could possibly pull off a twist as shocking and meta as the finale of "Newhart," which is perhaps better remembered than the show itself. After Dick Loudon (Bob Newhart) is hit in the head with a golf ball, the show cuts to Dr. Robert Hartley, Newhart's character from his previous series, "The Bob Newhart Show," waking up from a dream in bed with his wife. All eight seasons of "Newhart," set in a Vermont inn, were Hartley's dream. Not even "Westworld" could do better.

3. "M*A*S*H" (CBS)

In a poignant, emotional and still top-rated finale, the 11-year run of M*A*S*H (eight years longer than the Korean War it depicted) came to an end as Hawkeye Pierce (Alan Alda) and (most of) the rest finally went home. The sometimes dark final episode, which manages one last "war is hell" moment, perfectly captured the spirit of the series.

4. "The Mary Tyler Moore Show" (CBS)

Just thinking about that loving final hug is enough to make any "MTM" fan tear up. The finale ended in the sad, inescapable way many jobs in the real world do. The new owner of WJM fired the entire TV newsroom (well, except Ted), and the former co-workers came together to say goodbye. It felt realistic and emotional, just like most of the series' run.

5. "Battlestar Galactica" (Syfy)

The finale to the space epic succeeded where "Lost" and "Thrones" failed, finding a way to use the spiritual and divine to answer its mysteries while making a profound statement about the nature of humanity. Sure, some are still angered by the deus ex machina convenience of the messy, benevolent god guiding the humans and cylons alike, but the relationship between creators and their creations was always the central tenet of the series. And even though the humans and the Cylons gave up technology to start a simpler life on Earth, the flash forward to modern robotics also emphasized the show's themes: All this has happened before, and will again. So say we all.

6. "The Sopranos" (HBO)

The only bad thing you can say about "The Sopranos" finale is that it pushed the saturation of Journey's "Don't Stop Believin'" to the breaking point in the years that followed. Some fans didn't take to the open-ended, cut-to-black finale of the mobster drama, which didn't reveal whether Tony Soprano (James Gandolfini) lived or died, but his life was too nebulous to be resolved so cleanly.

7. "The Americans" (FX)

The beautiful finale episode, which found Philip (Matthew Rhys) and Elizabeth (Keri Russell) returning to the Soviet Union after the FBI finally figured out their secret, was perfectly suited to the series. They left behind their unwitting son, Henry (Keidrich Sellati), and their comrade daughter, Paige (Holly Taylor), leaves them. This is as close to a happy ending as the series could offer, at once surprising and deeply satisfying.

8. "The Shield" (FX)

Not every series about an anti-hero is interested in comeuppance at the end, but even if it did, no punishment would be as perfect as the one served to Vic Mackey (Michael Chiklis) in the final episode of the police drama. Mackey ends up in his own version of prison, wasting away at an office job, far from the action and adrenaline he craves.

9. "Cheers" (NBC)

Sam's (Ted Danson) true love was always his bar. The "Cheers" finale isn't nearly as happy or funny as many sitcoms' exits, but its wistful tone worked for the bittersweet episode. The gang couldn't stay at the bar forever.

10. "Breaking Bad" (AMC)

Like any figure so tragic and Shakespearean, Walter White (Bryan Cranston) couldn't survive the end of his story. The cancer-ridden chemistry teacher-turned-drug kingpin had finally admitted his malicious acts were purely for pleasure but was able to at least partially redeem himself by helping Jesse (Aaron Paul), one of the people he hurt the most.

The worst

1. "How I Met Your Mother" (CBS)

The finale of the long-running young-friends-in-New York sitcom was legendary, for all the wrong reasons. The episode finally introduced Ted (Josh Radnor) to the mother (Cristin Milioti) of his future children and then, in a series of flash-forwards, proceeded to kill her off and have Ted rekindle his relationship with Robin (Cobie Smulders) after she divorced Barney (Neil Patrick Harris). Had the show not proved that Ted and Robin were a bad couple many times over, and had it not set the entire last season at Robin and Barney's wedding, it might have been able to pull off this ending. Instead, it marked a classic example of a series that mapped out a plan from the beginning but shouldn't have stuck to it.

2. "Seinfeld" (NBC)

That's it? The decision to end the beloved sitcom about a group of New York misanthropes by putting them in jail for being bad Samaritans is now 20 years old, but age hasn't helped it.

3. "Lost" (ABC)

A show that wove as many mysteries into its fabric as this supernatural drama did was always bound to dissatisfy some with its conclusion, but the easy, schmaltzy way that the series gave everyone a perfect happy ending in the afterlife was the worst choice.

4. "Game of Thrones" (HBO)

The wounds of the controversial "Thrones" series finale are still very fresh, so maybe in a year or two, we won't look back so harshly on it. But sour series finales rarely get better with age (just ask the three that top our "worst" list). The problem with the "Thrones" finale is that it offered a perfect, fairy tale ending for its characters, betraying the realism and unjust world the series spent eight years building. A happy ending rarely works on TV dramas, and it especially didn't work here.

5. "Dexter" (Showtime)

The serial-killer drama started to decline long before its much-derided finale, but that didn't help soften the blow of Dexter's (Michael C. Hall) bizarre decision to fake his own death and take up life as a somber lumberjack.

'Game of Thrones' is dead. Long live 'Game of Thrones':