When NCIS producers were prepping for Michael Weatherly's departure, it quickly became apparent that there was only one way to go.

"We knew that we had to come up with something extraordinarily significant that would be the only thing that could get Tony DiNozzo to leave his NCIS family," NCIS executive producer Gary Glasberg told TVGuide.com. "And the only version that really made sense to us was to not only have there be a child involved, but if there wasn't anyone else for that child, then it had to be Tony."

Unfortunately, Tony's newfound fatherhood came at a hefty price, as he only found out he had a daughter after her mother, Ziva David (Cote de Pablo), was killed (off-screen). Read our full Q&A with Glasberg to find out the decision to kill Ziva off, as well as whether we'll see former Agent DiNozzo in any future episodes of NCIS.

NCIS: 14 things we'll miss about Tony DiNozzo

TVGuide.com: How did you arrive at the storyline about how to write Tony out?
Glasberg:
It was a conversation for many, many months prior, and we went through many different incarnations and ideas. This was something that I take responsibility for. We knew that we had to come up with something extraordinarily significant that would be the only thing that could get Tony DiNozzo to leave his NCIS family. And the only version that really made sense to us was to not only have there be a child involved, but if there wasn't anyone else for that child, then it had to be Tony.

It brought up the decision ... of, when you're a field agent, when you're a law enforcement officer, and you put your life in jeopardy every day, and you have this responsibility to a child, does that change your perspective on your job? And the answer is yes. So, we really did feel like it took this kind of loss and this kind of gain, in realizing that he now has a child and a family, to be enough to drive Tony to leave.

And the decision to kill Ziva - how much was that motivated by you hoping that people like me will stop asking you if Ziva's coming back?
Glasberg:
It wasn't a motivation at all! I have to say, everything that you experienced [Tuesday] night came from a place of, from our perspective, servicing the story as best we could and motivating the character in the best way that we could come up with. And the best way that we could come up with was to give him a crossroads, to come up with a situation in his life where he had to choose. That was, in our minds, the best we could do.

What was Michael's reaction when you pitched the storyline?
Glasberg:
Michael's a real pro. We were in constant communication, and even though we were making other episodes, the subject kept coming up and we talked our way through. Other writers discussed it. It was a tremendous amount of back-and-forth that went on amongst everybody.

NCIS Finale Recap: Why did Tony DiNozzo leave?

Is Tony and Ziva's daughter a plot point that would have been introduced even if Michael hadn't left the show?
Glasberg:
It's always hard to try to imagine, if things had worked out differently, where we would be going. I think there was always a part of us that, like the fans, saw Ziva and Tony connecting in a personal way as the show progressed. But I think by doing what we did, we've given him... A part of her that he will continue with forever. And that was really the best that we could do.

Was there ever any discussion about trying to get Cote to come back for this episode?
Glasberg:
Specifically for this storyline, we landed on the child and the approach that we wanted to have early on, so we always anticipated we would use flashbacks and things like that. There was discussion not so much for the finale, but for an earlier period of time when we were talking to Cote. But that didn't work out, so in this instance, we just moved forward with the Tali storyline, because that's what we thought we had to work with.

Do you feel comfortable discussing any of the other ideas you had that were ultimately rejected?
Glasberg:
No. (Laughs) At the end of the day I feel like we landed on the appropriate decision and, again, wanted to provide the most emotional opportunity for Michael, for his performance, for the audience that we could at the end of the season. Again, you come up with a lot of ideas in process, but I think we landed on the correct one.

Watch Michael Weatherly's farewell message to NCIS fans

Michael said he's open to future guest appearances. Is that something you'd be open to as well?
Glasberg:
Michael will always be a part of the NCIS family and we will always be open to hearing any ideas along the way.

What was it like on set during his last day? Was the heartfelt goodbye we saw between Tony and the rest of the NCIS team pretty true to life?
Glasberg:
That was actually his last scene as well. We made a point of filming that last moment as his last scene. It was great. Everyone acknowledges the opportunity that Michael had in terms of Bull. Everyone acknowledges his desire to move on, and now it's time for us to focus on moving forward as well. So, it was gracious and professional and courteous and lovely. And it ended with a huge round of applause from the crew and lots of hugs, and now we look forward to what comes next. I'm excited that people went along for the ride and now it's time for us to get back to ... really significant and strong NCIS episodes in Season 14.

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