Homelandended its eighth and final season Sunday with a tense episode that forever changed the fate of Carrie Mathison.

Major spoilersfor “Prisoners of War,” the series finale of Showtime’sHomeland,in the interview that follows.

Saul called Carrie’s bluff and she found a way to burn the asset anyway.

ENTERTAINMENT WEEKLY: How long have you had this ending in mind?

ALEX GANSA: Not that long.

We started talking aboutthe finaleas we got episodes nine and 10 as we were breaking the season.

Like, “If we make this decision here, where is it going to lead?

How are we going to get to an ending that we like?”

We knew we wanted Carrie to wind up in Russia.

We had that as a landmark ahead of us.

But how she got there and what happened when got there was very much up for debate.

But we wanted more for her than that.

And also a mission.

She takes the asset’s place.

So I felt like it worked.

In some ways, you get to have your cake and eat it too.

Does Carrie betray her country or continue as a CIA spy?

And she begins to repair the relationship with Saul, which was important to us.

Martin long promised a “bittersweet” ending forGame of Thronesand that’s also the best word for yours.

That’s just undeniable.

She did it for her own reasons, but she’s got blood on her hands for sure.

I think she does.

She loves him in the way that Carrie can love somebody.

But, of course, she’s using him too.

Was there any debate about Carrie ending up with a man like him?

I never read that book.

We tried togive her a normal life in season fiveand it was just untenable for her.

She couldn’t tolerate that.

She has to exist in these heightened, exaggerated situations and clearly, this is one of them.

That was the real difficult part of constructing the coda of the episode.

What had Carrie been up to for two years?

How was she able to provide cover for herself to resume her espionage work?

That was the difficult thing and we didn’t realize that until 24 hours before we shot the finale.

If Gromov discovered her betrayal, would he protect her or turn her in?

How did Claire Danes react after she read the script?

Mandy, Carrie, [executive producersLesli Glatter,Howard Gordon].

We were all wrestling with this and it went through many iterations.

Ultimately, it kind of boiled down to me and Claire.

The story progresses in everybody’s mind, just not as a TV show.

What about Mandy Patinkin, what was his take?

Mandy was always advocating for some sort of hopeful ending.

He felt the season up to that point had been very tragic and grim and hopeless.

He was pushing for something that lifted people up rather than devastated and crushed them.

That was a really important voice in the mix.

I leave that up to our fans.

I think that she felt very strongly about avoiding another mass casualty situation.

She knew that she wasn’t going to kill Saul in the scene.

She was hoping to scare him to death so that he would give her the asset’s name.

So she was taking a big chance.

What was the closest runner-up idea that you didn’t go with?

There really wasn’t a close second.

One of the close seconds was that she actually killed him.

But that was a distant second.

You don’t want to do what you’ve telegraphed.

That is completely accurate.

That’s exactly how we doled out the music.

And wasn’t Kamasi Washington so great?

Your ending rather firmly leaves bring up the possibility of revisiting these characters in the future.

IfNetflixbacked up the money truck five years from now for aHomelandmovie, are you down?

As Howard has said, “never say never.”

All of us are happy with where we ended the show and the series.

Another chapter doesn’t feel necessary at the moment.

But who knows what’s going to happen?

Who knows what Claire and Mandy want to do?

Who knows what Howard wants to do?

We don’t know what that looks like.

For now, it feels like closure.