[Warning: This article contains major spoilers about Wednesday's episode of The Mentalist. Read at your own risk!]

Will the death of a colleague cause Patrick Jane (Simon Baker) to give up crime-fighting for good?

On Wednesday's episode of The Mentalist, rookie FBI agent Michelle Vega (Josie Loren) was fatally wounded during a shootout, and her shocking death sent ripples of anger and doubt through the other members of the bureau. Namely, with only two episodes left before the series ends, it seems as though a heartbroken Jane is ready to walk away from police work entirely. But will Lisbon (Robin Tunney) join him?

Mentalist's final season promises an "unconventional" Lisbon/Jane romance

"It's definitely a catalyst," executive producer Tom Szentgyorgyi tells TVGuide.com about Vega's death. "This is the crossroads. In a way, because we killed off Red John in Season 6, we've been able to look at the arc of the seventh season not just as a man seeking revenge for the death of his wife and daughter, but a man who's suffered a great trauma and he's fighting his way back to embracing life in its fullest. These last episodes are about that last step. This death is a catalyst for that last step. What step he takes I won't tell you - you'll have to watch."

Read our full Q&A with Szentgyorgyi and Loren to find out when the writing team decided to kill off Vega and why, and what it was like for Loren to film her first death scene.

TVGuide.com: Tom, when did you decide to kill off Vega's character?
Szentgyorgyi:
It was something we'd planned from the very beginning. We knew coming into this [final] season that there were two things we wanted to do. We wanted to bring a character into the team who didn't know Jane, who was new to Jane and new to his ways, and would cast at least a skeptical eye on what he was doing, his methods. The second thing we wanted to do was ... to go back to the beginning. We were going to return to the emotional stakes and issues that had really launched Patrick Jane and launched the show ... a world of loss and death, and the struggle to deal with those things. So we put those two things together and decided that what we wanted to do was create a character for everyone to fall in love with, and then kill them, and use that to launch the sort of last run of episodes for Patrick Jane.

Josie, how did you find out Vega was going to die?
Loren: Tom called me the day before I was supposed to start shooting the first episode and he let me know exactly what was in store for my character. He also asked me to please keep it a secret. So, the cast didn't even know for a long, long time. It was something that was very much kept under wraps. But it was hard for me to keep it a secret, because I knew from the very beginning.

The best and worst TV time jumps

Were you disappointed when you heard the news?
Loren: I think the story line was great. As much as I would have loved to have done the full 13 episodes, because they're a wonderful cast and crew and it was a great experience, I love Vega's storyline and I love what it does for the show.

Did knowing the outcome inform your portrayal of Vega? Would you have done anything differently if you hadn't known she was going to be killed eventually?
Loren:
It's funny. I never thought about that. But I don't think I would have done anything any differently. She's so strict and by the book, but she has so much heart and she has so much passion. And I would have had that in my character regardless if I knew she was going to pass or not.

What was the rest of the cast's reaction when they found out?
Szentgyorgyi: We kept it completely secret, and then when the script went out and people found out, a number of people came up to us on the writing staff and said, 'Do we have to do this?' Because, frankly, we had all fallen in love with Michelle Vega and with Josie's portrait of her. There was a real sense - which is sadly good, because we want to get that sense - that someone was being snatched from us. And it's deep. It's a really widespread sense of regret and sorrow.

It's been nice to see the contrast between Vega's and Jane's tactics this season - the veteran and the newbie.
Loren: It's kind of funny, because it's very true to real life. I walked onto a set where these people have been together for seven years, especially Simon and Tim [Kang] and Robin. So, that wasn't very much of a stretch for me. I was not an avid watcher of The Mentalistbefore I got on. Obviously once I was auditioning and testing, I watched episodes to brief me on the show and its tone and the characters. So, for me, it wasn't very difficult ... To fall into that in its seventh year, it was like playing catch-up and figuring out everyone's quirks and how everyone works and what makes them unique and special.

Winter TV Preview: Get scoop on must-watch new shows

Was it weird for you to film the actual scene itself?
Loren:
It's so hard to describe. We had such a long day that day. I think it was a 14-, 15-hour day, and it was the last thing that I shot, and they continued on after that. But all day, it was sad because it was my last day. I'm usually very outgoing and laughing and talking to the crew. ... I've never died on camera, but I would say it was something like, you live in that kind of zone all day, in that mentality. And I never expected also to be sad for Vega, for Michelle, this character who I grew to really love and admire. She was dying that day, and there would never be another Michelle Vega. There's a lot of sadness in that too. Shooting it, I actually never got off the ground. Once they placed me on the ground, I never got up once to set up the next shot or anything. I just laid there for, I think it was a little over an hour, on a very dirty floor, covered in blood, folks walking all around me. I just wanted to be in that kind of space.

Szentgyorgyi: There was a unique and really keen sense of loss that day. Josie did such a great job, beyond our expectations, of bringing Michelle Vega to life. We felt like we were all losing a friend, even as we watched her wash the blood off.

We've already seen a bit of Jane's reaction to Vega's death, but what impact will it have on the rest of the team?
Szentgyorgyi: Everyone had a very particular and affectionate relationship with her. So, it's a loss felt by everyone. We wanted the death to echo what had happened to Jane with his wife and daughter, but not be exactly the same - not be a loss that happened to Jane alone. We wanted everyone to be in Jane's shoes and just face the challenge that faces anyone when someone is taken from them. ... A death like that really is a thing that makes you reassess, and in an odd way it can be a sort of spur to move forward. Ironically but realistically, the death of someone close to you forces you to change, whether you want to or not. Sometimes it's not a change you want to undergo, but it does. And all the characters are going to be going through that in one way or another.

What did you think of the episode? Were you shocked by Vega's death? And do you think Lisbon and Jane will walk away from the FBI? Sound off in the comments!

The Mentalist airs Wednesdays at 8/7c on CBS.

(Full disclosure: TVGuide.com is owned by CBS.)