An uneasy transfer of power in Washington, the plague of fake news and legal targeting of Muslims were the big themes of “Homeland’s” sixth season.

In keeping with the show’s prescient tradition, those topics were also front and center in real-world headlines during the show’s run, which concludes Sunday with the finale, “America First,” written by Alex Gansa and Ron Nyswaner and directed by Lesli Linka Glatter.

“Homeland” showrunner/exec producer Alex Gansa took time out from putting the finishing touches on the episode to speak with Variety about surprises from this season, adjustments made along the way, and his hope to return Carrie Mathison to full-time intelligence work soon. He also says they’re hoping to map out a two-season storyline for what’s expected to be the show’s final outings in seasons seven and eight.

“Homeland” storylines usually reflect real-world headlines in some way. What surprised you this year about how your show dovetailed with real events?

The most surprising and alarming coincidence was that the very thing we had posited a year ago in February — that is a President-elect in an adversarial relationship with her own intelligence community – actually came to the fore after President Trump got elected was just a coincidence of epic proportions. Frankly that was the biggest surprise second only to the fact that Donald Trump got elected in the first place. That dynamic – a newly elected President at war with her intelligence community was really the fulcrum that the entire season hinged on. The fact that it played out in the real world on the national stage was shocking to witness. There were some other (developments) that made us go back into some episodes to retrofit them.

Can you give an example?

The whole idea of fake news and propaganda – that seemed to take on a much more prominent role as we moved into our story. The one major thing we went back in and changed was introducing our Brett O’Keefe character much earlier than we intended. He was originally scheduled to be introduced in episode eight. But we went back in and did some reshoots and new scenes to introduce him in episode two.

Actor Jake Weber has been terrific in the role.

I’m told (conservative firebrand) Alex Jones has challenged him to a fist fight.

Weber’s face-off with Elizabeth Marvel as President-elect Elizabeth Keane in episode 11 was one of the more intense scenes of the season.

These are two characters who just appeared this season – the fact that they could command such a powerful place in this episode is a testament to their skills as actors. The two of them together was just electric.

You were clear all along in the lead-up to season six that “Homeland’s” female President-elect was not meant to be a thinly veiled Hillary Clinton. But were you concerned about that choice after Trump pulled off his upset win?

Absolutely. There was a moment we all just slapped our foreheads and wondered if the show was going to be irrelevant from that point forward. However, the story of the President-elect in an adversarial situation with her own intelligence community, that certainly wouldn’t have been Hillary Clinton. She was an establishment candidate. She was front and center of American foreign policy for years. …In a crazy way, the show would have been more irrelevant if Hillary would have been elected. The fact that Donald Trump and his team were in such a contentious relationship made the show feel current and contemporaneous. We lost on the gender but we certainly gained on the dynamic.

Have you gotten any feedback on the show from Trump or anyone in the administration?

Not a word. I have absolutely no idea if he watches.

You and the rest of the “Homeland” team are known for making an annual research trip to Washington, D.C. to connect with the real Carrie Mathisons and Saul Berensons. Are you concerned about access in the Trump era?

That’s a very good point. There are apparently commissars set up in all these departments to ensure loyalty to the new president. We’re headed to D.C. at the end of this month. I’ll report back.

Will President Keane have any presence in season seven?

I have to plead the Fifth on that. I don’t want to say anything that directly impacts what happens in (Sunday’s) finale.

In bringing the show to New York, was it a challenge to craft a storyline that was focused on the home front? There was no external menace to battle this time around.

The decision not to dramatize some big terrorist attack on New York City happened very early in the story (development) process. On our annual field trip to D.C. a year ago February, we were told in no uncertain terms by our intelligence community consultants, the State Department and military and CIA people that we talked to that there were no coordinated terror cells in the United States like there are in Europe. We did not want to dramatize on “Homeland” any threats to the United States that did not exist. That made us have to reconceive our idea of the villain. It did require a lot of trial and error to get us to the place where we wound up. We settled on the people inside our government.

Is there a reckoning coming for Carrie and Peter Quinn coming in Sunday’s finale?

If you remember how the season began, the very first drama this season was between Carrie and Quinn in the veterans’ hospital. That in our minds was the emotional center of this season – the unique and singular relationship between Carrie Mathison and Peter Quinn. We really tried to investigate that this year.

Is there anything you’ll divulge about plans for season seven?

One thing I can tell you about next season is that we have to get Carrie back into the intelligence business. She’s been out of it for two years. It’s time for her to return. We have to construct some sort of narrative to allow that to happen.

As you head in to what is expected to be the show’s final two seasons, are you mapping out seasons seven and eight as a single story arc? Or will you reset the storyline as you have in each season to date?

I’m really at the very beginning of thinking about the last two seasons. The hope would be to tell one story that takes us through the last two seasons so that we don’t have to reinvent in the last season. We’d like to start a story in season seven that brings the series in for a landing. We’ll see if that happens. That’s the hope. (But) it’s hard to know until we start noodling around and make our trip to D.C. and until we decide where we want Carrie Mathison to be at the end of this journey.