The minds behind the hit Showtime series “Homeland” were given direction and advice on the show from the Central Intelligence Agency after meeting with them during the Obama administration.

In a roundtable discussion about the show for The Hollywood Reporter ahead of its eighth and final season, the people who make "Homeland" revealed that they were granted a meeting with several CIA officials at the agency’s headquarters in Langley, Va.

“A meeting was arranged between the cast, the network and the CIA at Langley. They confiscated our cellphones, and our whole team is just sitting there across from maybe 50 CIA agents,” former executive vice president of original programming at Showtime, Gary Levine, shared.

CLAIRE DANES SAYS 'HOMELAND' WILL END AFTER SEASON 8

Former president of entertainment at Showtime David Nevins added that John Brennan, who was acting CIA director from 2013 until 2017 under President Barack Obama, stopped by the meeting as well.

“John Brennan, who was running the CIA at the time, came out in the middle and says, ‘I don't know what your show is, but I know it matters to my people.’"

Levine explained that Brennan seemed excited to show Mandy Patinkin his office, joking that it belonged to the actor given the fact his character became director of the CIA in a previous season.

Later in the discussion, the group talked about the time they were able to meet whistleblower Edward Snowden via video chat while he was in Moscow.

'HOMELAND' TAKES A LEFT TURN? NEW SEASON FOCUSES ON MUSLIM CIVIL RIGHTS, FEMALE PRESIDENT-ELECT'S CIA BATTLES

“You knew everyone at the CIA, the FBI and the GRU in Russia were listening in. You just knew it,” Patinkin commented. “I tried my butt off to get him to talk about personal stuff, but we couldn't budge him from his soapbox.”

Eventually, the conversation turned to what the “Homeland” team learned about Donald Trump in relation to the intelligence community following his win over Hillary Clinton in the 2016 election.

“When Trump was elected, all of the sudden we didn't have to bring these people in through separate entrances,” showrunner Alex Gansa explained “The press and the 'deep state,' if you want to call it that, were both really freaked out by this president.”

CLICK HERE TO GET THE FOX NEWS APP

Gansa added: “One thing that we learned is that you keep American foreign policy consistent from one administration to the next. The worst thing you can do is to backtrack, like to say no to the Climate Change Agreement or the Iran treaty. That is anathema for the intelligence community because it rocks the boat. It makes nobody trust us abroad.”