SPOILER ALERT: This story contains details of tonight’s Season 1 finale of The Flash.

Team Flash lost a key member in tonight’s Season 1 finale of the hit CW drama when in the final minutes, Rick Consett’s Det. Eddie Thawne took his own life to stop Reverse Flash and save his friends.

Introduced as partner to Det. Joe West (Jesse L. Martin) and boyfriend of Joe’s daughter, Iris West (Candice Patton), Eddie developed a friendship with Barry Allen (Grant Gustin), despite the two being in love with the same woman. Eddie’s fate started to take a dangerous turn a few episodes ago when he was kidnapped by Dr. Harrison Wells (Tom Cavanagh), recently revealed as Eobard Thawne, a distant relative of Eddie’s and mortal enemy of The Flash. In tonight’s finale, after getting his plan to get back to the future and harness The Flash’s speed thwarted, Eobard Thawne (aka Reverse Flash) moved on to destroy Team Flash. As his relative, Eddie sacrificed himself, knowing that if he takes his own life, Eobard (Reverse Flash) will never exist.

The Flash co-creator/executive producer Andrew Kreisberg said the explosive Season 1 conclusion had been a long time in the making, starting with the conscious choice of the last name for Eddie’s character. “It was there to be done if we decided to go in that direction,” Kreisberg said of the character’s heroic death. As for how the “difficult decision” to take that direction was made, “the show tells you where it wants to go,” Kreisberg said. “Despite how much we adore the character of Eddie and truly adore Rick as a professional and a friend, this was what was best for Eddie and all the other characters, what was best for the show.”

Eddie’s “stunning, emotionally gut-wrenching” death “brings the show to a high point at the end” of the season, Kreisberg said. “Having someone do the ultimate sacrifice ups the life-and-death stakes.” The suicide also punctuates Eddie’s storyline with a grand ending. “At the end of the day, he dies knowing he is a hero, he eliminates Eobard from existence.”

Eddie’s death will reverberate next season. “Eddie was a large part of everyone’s life,” Kreisberg said. “He and Iris spent a year and a half together, and he died for her. Joe has lost a partner, and Barry has lost a friend. Eddie’s death will have a major impact on all of their lives as they cope and figure out how to move forward in Season 2.”

As for Dr. Harrison Wells, while Eobard Thawne, who’d taken over Wells’ body, is presumed dead, and his alter ego, Reverse Flash, has been defeated, Cavanagh would return to The Flash next season, Kreisberg said. He wouldn’t elaborate on how Wells will be reintroduced, but the series relies heavily on time travel, so that will likely play in a role in Wells’ future comeback.

The Season 1 finale, which Kreisberg calls a “satisfying conclusion to the year,” ends with a cliffhanger as a black hole looms over Central City. Kreisberg would not reveal what happens next beyond saying that the show “will come back exciting and surprising” next fall with a new mystery and new characters from the comic books. He also hinted at more characters crossing over between Flash, Arrow and the new offshoot Legends Of Tomorrow.