Nathan Fillion and Stana Katic, <i>Castle</i> Nathan Fillion and Stana Katic, Castle

[WARNING: The following story contains major spoilers from the Season 3 finale of Castle. Read at your own risk.]

Castle's third season went out with a bang. More than one, actually.

Castle finale: Castle and Beckett put all their cards on the table

The action-packed final episode found Beckett (Stana Katic

) once again drawn into investigating her mother's murder after Hal Lockwood (Max Martini), the hitman who has killed all her previous leads in the case, escapes from prison. Beckett soon learns that Lockwood's next target is none other than Captain Montgomery (Ruben Santiago-Hudson), who was the third cop involved in the kidnapping of a mob boss that ultimately led to Beckett's mother's murder.Mongtomery's betrayal and cover-up is a hard pill for Beckett to swallow, but ultimately the Captain risks his own life to take down Lockwood and protect Beckett from further harm. One problem: Montgomery dies without revealing the real mystery man who sent Lockwood to kill the conspiring cops in the first place. And that mystery man seems to have hired a new gunman, as in the closing moments of the episode, Beckett is gunned down by a sniper and left bleeding out as Castle (Nathan FIllion) professes his love to her.

Exclusive: Marvel and ABC team for Castle-inspired graphic novel

If you're anything like us, you're still in shock. And you have plenty of questions. (Of course Beckett is going to live, silly!)  Luckily, we chatted with Castle creator Andrew W. Marlowe to break it all down. Below in our exclusive interview, Marlowe reveals why the Captain had to die, what the next layer of mythology in the Johanna Beckett case involves, and just how Castle's admission of love will play out next season.Why did you decide to kill Captain Montgomery?Andrew W. Marlowe:  It grew organically out of the series, out of who he is to Beckett and why he's been such a mentor [to her]. We realized when we got deeper into Beckett's mother's murder mythology that somebody had to be protecting Beckett from herself when she was looking into this, so it made sense that the Captain was involved. It gave us this great sense of completeness and tragedy that I really responded to.Were you worried that fans might be too jarred by the betrayal?Marlowe: We wanted them to be jarred. Beckett's jarred. But the reality is we all have secrets and things in our lives we don't talk about that, when they come to light, we're forced to deal with. I think there will be some fans who will be frustrated and angry and some fans will be interested in how this will affect Beckett. What's Beckett's life going to be like when she doesn't necessarily always have somebody she works for in her corner?Captain Montgomery at least got a little bit of redemption.Marlowe: [The whole story] made the character of the Captain much more noble to me. He participated in something that was a sin in his youth, but he had done everything in his life to correct it, to overcome it. He'd done everything to serve and be a good man, but he could not outrun his sins.

Check out photos of the Castle cast

So will you be adding a new boss at the precinct next season?

Marlowe: That's one of the opportunities we're looking to take. Everybody's getting along really well in the precinct, and we think there can be a little more conflict. We think it's interesting to grow Beckett and Castle by having somebody who may not look as favorably on Beckett as the Captain did or may not look as favorably on the Castle-Beckett relationship. That's all stuff we're plotting out for next year as we speak.

The finale also reveals that there's still a mystery man out there connected to Johanna Beckett's murder.
Marlowe: We have a great concept of how we want to follow that up in the next couple of seasons. That's going to be vital in some decisions I'm making going into next season.  We foreshadowed it a bit with Castle having to protect Beckett from herself at the end of the episode. Next season, with Castle knowing somebody is out there, [Beckett] becomes his responsibility. It changes the nature of their relationship and makes it significantly more interesting, especially given what happens the last 10 seconds of the show.

Indeed. Let's talk about that cliff-hanger. Are you prepared for the hate mail?
Marlowe: I do have an expectation that certain fans are going to be really, really frustrated. We have really tremendous, loyal fans and to make them wait all those months I think is going to be really frustrating to them. Hopefully people will be interested to see how we deal with it next year.  I do think, for the relationship fans, having Castle admit his feelings to Beckett is a great moment for them.

Did Beckett hear and understand Castle say "I love you" before she went unconscious?
Marlowe: I think in that moment she does. I know exactly how I'm dealing with it next season, but it would be unfair to the experience of the audience to tell them right now. 

What can you say about that relationship moving forward?
Marlowe: I think people will be frustrated until I do the next set of reveals at midseason. My feeling about TV audiences is that they love to be frustrated and then fulfilled. What we're telling here is a great love story, and great love stories take a long time to resolve. Feelings ebb and flow, relationships are complicated, timing is wrong. I do know where I want to end up with these people. I know what the resolution is between them but there's a lot of great storytelling between now and then.

Are you concerned with dragging it too long and losing viewer interest? You recently commented about Bones doing just that.
Marlowe: When I express some concerns about models of the other shows, it's when the relationship becomes stagnant. When there is no movement, there is no growth and the characters start to feel like brother and sister because they lose the spark. My goal is to not lose the spark, and I know that's a challenge when you keep people apart for a long time. Keeping them apart can be frustrating, but I also feel like moments at the end of the swimmer episode are enormously gratifying because of everything that's come before. The hero's journey is about going through all sorts of difficulty to obtain your prize and having little victories along the way. My hope is that at the end of the day, it feels like a hero's journey.

Will there at least be some payoff to Castle's admission of love?
During Season 4 there will be some payoff to what he said in that moment. It's not going to necessarily come the way the fans like. And I'm sure some of them will feel like I've skirted the issue initially and then come to realize that I've dealt with it in an interesting character way. The questions are going to be answered. I think people felt like we dropped the kiss or we dropped the freezing together, but it was always my intention to bring it up as a relationship issue [in the finale]. Hopefully people will be interested to see how we deal with it next year, and how we overcome the argument they've had in the middle of this episode. The issue of "Why aren't we talking about this? Why aren't we confronting it?"

Is Beckett's boyfriend Josh (Victor Webster) still a possible obstacle?
Marlowe: He's still out there, and he's somebody we're going to have to deal with. He's an element moving forward and it'll be interesting to see how that functions.

What's going to be the driving force in Season 4?
Marlowe: There's going to be a real push and pull between Beckett and Castle. Beckett's going to want to look into [this new mystery man] and Castle's going to have very specific reasons why he doesn't want her to. He'll end up with a little more information than she has, and he can't be honest with her about it. It's going to cause a complexity in their relationship that's going to be interesting.

What did you think of the finale? Were you shocked by the Captain's death? Are you excited that Castle admitted his feelings? Share all your thoughts in the comments.