Warning: This post contains major spoilers from this week’s episode of “Jane the Virgin.” 

Ahead of Monday night’s “Jane the Virgin,” several cast members implored fans to watch live (or avoid social media until they were caught up). Now we know why. While most of the episode featured the show’s trademark telenovela-inspired comedy, the ending was a tear-jerker that will permanently alter Jane’s story.

Some fans struggled to process the heartbreaking turn of events.

Jane and her husband, Michael, have been navigating a stressful period in their young marriage, with Jane trying to get a full-time job in publishing and Michael preparing to take his Law School Admissions Test (LSAT). This week, a pregnancy scare added to their stress before ultimately making them realize that they might be ready to give 18-month-old Mateo a sibling sooner than they had initially planned. To distract themselves from the mounting pressure, Jane and Michael sweetly recreated their first official date at the local carnival.

But there was an ominous undercurrent to this week’s episode. Michael, who was shot in last season’s dramatic finale, admitted to feeling a bit off, but attributed it to being nervous about his upcoming test. The show’s jovial storyteller repeatedly reminded us that he is not an unreliable narrator. And he prefaced the opening scene — a flashback to Michael as a child, unable to go trick-or-treating because he was sick — with these words: “Looking back, you could say it felt different right away, which might be true — or it might just be memory.”

As Michael told Jane about his worst Halloween, the narrator explained the phenomenon known as flashbulb memory: “Apparently, memories around big events seem clearer, but the periphery disappears. You remember the feeling, but not the details.”

That sentiment resurfaced near the end of the episode when Jane sent Michael off to take the LSAT and told him that she would be taking him to the doctor later if he wasn’t feeling better. “I am so proud of you,” she said before he left. “And, friends, it should be noted that Jane would play this moment over and over until it became a memory,” the narrator told us. “And therefore, unreliable.”

A few scenes later, we saw Michael pass out in the test room. Then we saw Jane on her cellphone as a doctor delivered the gut-wrenching news. “Your husband’s death was ultimately the result of his gunshot wound. His blood pressure spiked.” Trembling, Jane dropped her phone and fell to the floor screaming. Rafael, who had arrived to pick up Mateo, rushed in to console Jane.

The show then jumped three years forward to a scene that saw Jane and Mateo preparing to attend a mysterious wedding. On Twitter, the show’s writers promised that next week’s episode will reveal whose wedding it is. It will also show Jane grieving in the immediate aftermath of Michael’s death.

Michael’s death wasn’t entirely unexpected. Fans have speculated since the show’s first season that Michael would meet an untimely fate. In those early episodes, Jane and Michael’s relationship was in jeopardy because Jane was having Rafael’s baby — the result of an accidental artificial insemination. As the situation grew into a bona fide love triangle, Michael told Jane that he would never stop believing that they were meant to be together. “For as long as Michael lived, until he drew his very last breath, he never did,” the narrator told us then.

Still, given that Michael survived the Season 3 premiere and had started settling into married life with Jane, some fans may not have been anticipating his death this early on. And character deaths are a particularly fraught topic when it comes to CW shows. Some viewers protested “The 100″ last year after the teen dystopian drama killed off several major characters — including a beloved lesbian character — and started an online campaign geared toward raising awareness of television’s propensity to kill off LGBT characters. Michael’s death doesn’t fall into this trope, but it did lead some social media users to reference the network’s history of fan-favorite character deaths.

In an emotional Tumblr post addressed to “dearest Jane fans,” showrunner Jennie Urman said that “this was a devastating episode to write.”

“It was also a decision made very early on, when I thought about our story as a whole,” she continued. “And even in season one, I knew it would be a hard thing to actually do, which is why there was a line (which many of you noticed) about how Michael would never stop loving Jane.”

Urman wrote that from the very beginning, “the writers could all see the magic of Jane and Michael together,” and went on to praise actor Brett Dier.

Originally, I thought Michael would die earlier. But Brett is such an incredible actor — he gave us such great comedy and drama and first-rate exposition delivery (!), often all in one scene. And he and Gina … well, there’s that word again — magic. So, we changed some things in the writers’ room. Jane and Michael got married. They had sex. They moved into their first home. And I’m so glad we did that and I’m so glad all those firsts for Jane were with Michael. But this is a telenovela, as we so frequently remind you. And we are only at our midpoint.

As for the three-year time jump, Urman explained that the show will use flashbacks to fill in the gaps. “But mining emotions realistically is something we work hard on and we knew the immediate pain of that loss would overwhelm our storytelling,” she said.

Urman emphasized that Jane’s story — and happiness — is far from over. “She’ll always feel Michael’s absence (and trust me, we will too), but it opens up our storytelling in new and exciting ways, while allowing for the light and bright Jane world that we love to write.”