WARNING: The following contains spoilers for The 100 Season 7, Episode 10, "A Little Sacrifice," which aired Wednesday on The CW.

While The 100 broke fans' hearts again with the shocking death of Charmaine Diyoza, they can thank Ivana Milicevic's real-life pregnancy for keeping her character alive on the show for so long.

In an interview with TVLine about the episode "A Little Sacrifice," Milicevic revealed that Diyoza was initially written as "a McCreary type -- a really bad prisoner, a full-blown terrorist -- and she was absolutely going to die at the end of Season 5." Her pregnancy changed that, however, with showrunner Jason Rothenberg working a maternal element into Diyoza's arc to give her motivations more nuance. This allowed Diyoza to become a central part of Season 6 and 7's storylines. Or, to use Milicevic's own words: "My son coming into this world gave me three years of awesome work on an awesome show."

RELATED: The 100: Even JR Bourne Was Caught Off Guard by His Character's Villainous Twist

On the subject of fans being devastated by Diyoza’s death, Milicevic was touched, though admitted her longevity was a byproduct of that pregnancy. Milicevic noted that she "wasn’t going to be one of those actresses where you try to hide [the pregnancy]" on set, joking, "What was I going to do, hold a basketball or a laundry basket in front of my belly? So when the story took that turn, it naturally layered up a bit."

The final moments of "A Little Sacrifice" saw Clarke and her friends stop Echo from dropping a bioweapon into Bardos' water supply, only to be caught by Brother Anders. Diyoza's daughter Hope, still seeking vengeance against the Disciples for taking her mother away for so many years, killed Anders and attempted to drop the weapon in herself. In a heartbreaking but loving sacrifice, Diyoza caught the drop instead, saving Hope from repeating her past mistakes as a killer at the cost of being crystalized like the original Bardoans.

The synopsis for the seventh and final season of The 100 is below.

The seventh and final season opens with our heroes picking up the pieces of the society they destroyed on Sanctum. Still reeling from her mother’s death, Clarke, perhaps more than anyone, feels the toll of years upon years of fighting and loss. The group soon finds that maintaining order among the competing factions is no easy feat, and one that has them questioning whether their commitment to doing better was worth the price. At the same time, our heroes must contend with new obstacles on a scale beyond any that they previously experienced as they unravel the mysteries of the Anomaly. What they encounter on this epic journey pushes them to their limits both physically and emotionally, challenging their long-held conceptions of family, love, and sacrifice. Ultimately, our heroes must answer for themselves what it means to truly live, and not just survive.

The 100 stars Eliza Taylor, Marie Avgeropoulos, Bob Morley, Lindsey Morgan, Richard Harmon, Tasya Teles, Shannon Kook and J.R. Bourne. The series airs on Wednesdays at 8 p.m. ET/PT on The CW.

KEEP READING: The 100: Is 'Judgment Day' the Series' Endgame?