Homeland” wrapped a comeback year Sunday by returning its full focus to the United States’ maneuvers in the big scary world of geopolitical chess in the Middle East.

SPOILER ALERT: Stop reading if you haven’t seen “Homeland’s” season finale, “Long Time Coming.”

The show’s fourth season was eerily and tragically prescient about real-world events throughout its 12-episode run, right down to the season finale that aired five days after Taliban gunmen slaughtered 148 people, most of them children, at a Pakistani military school.

It’s taken as a given that “Homeland” stumbled from its own high bar in season three as the storyline focused too narrowly on flights of fancy and the doomed love affair between Carrie Mathison and Nicholas Brody. With Brody gone at the end of season three, the show was forced to reboot its plot engines and relationship dynamics. That gave the writing team led by showrunner Alex Gansa the flexibilty they needed to get the show back into its season-one form.

Gansa declined a post-mortem interview request, preferring to let the show do the talking. Showtime Networks prexy David Nevins said the planning for season four was not so much a reaction to criticism of season three as it was a desire to take Claire Danes’ Carrie into new territory — a place where she was in control, for the most part.

The writers “wanted to focus on America’s role in the world,” Nevins said of the overarching theme of the season. “What made this season so good was that it worked as an action show but it went back to the world of real political complexity. The show’s always best when it takes a complicated political story and wraps it in a complicated personal story. The writers really spent valuable time (early on) figuring out what story they wanted to tell. They told the story of how difficult America’s position in the world is in the 21st century. … They really got at the complexity of the U.S. position in the Muslim world.”

The horrendous slaughter at the military school reflected the dynamics portrayed throughout the season of the rifts within the Pakistani government and the degree to which the Taliban control parts of the country and sway policy decisions.

The headlines from the release earlier this month of the Senate’s long-awaited report on the CIA’s interrogation program in the years after 9/11 played right into the moral and tactical dilemmas that Carrie, Quinn, Saul and others wrestled with all season, right down to the closing “whoa” moment of the finale.

“Last night’s finale really brought that home,” Nevins said. “The conclusion is, you’re damned if you do and damned if you don’t. It’s not a simple question.”

It was also energizing this season to finally see Carrie at work in an official capacity rather than the rogue operative that she was for most of the first three seasons. “We wanted to see Carrie doing what she does best — working on foreign soil,” Nevins said. “That helped us build the new dynamics we needed this season to replace the Carrie-Brody dynamic.”

The always-complicated Carrie-Saul dynamic, meanwhile, went through plenty of changes. There’s no shortage of superlatives to describe the work done this season by Danes and Mandy Patinkin. But perhaps the strongest tribute is the fact that the finale’s closing scene — where Carrie realizes that Saul is willing to cut a deal with the devil (aka terrorist Haqqani) in order to get back into a CIA post — initially had them exchanging a bit of dialogue. In the final editing, however, Gansa realized they didn’t need any words. The emotion on Danes’ and Patinkin’s faces said it all, Nevins said.

As for the direction of season five, Nevins wasn’t about to leak any info. It’s unclear where the show will be shot, after spending season four in Cape Town, South Africa, which doubled for Islamabad and environs. Nevins said it’s likely that Gansa will take the writing team “on a field trip” to Washington, D.C., to meet with foreign service officials, members of the intelligence community and others who can add context and authenticity to the “Homeland” world.

Season four leaves off with CIA director Andrew Lockhart, Carrie and others waiting for the Beltway torture of congressional hearings into all that went wrong at the embassy. (Or as Carrie colorfully described it to her sister, the “mindf—” of a mission gone awry.)

“Homeland” is known to be must-see TV for President Obama and much of official Washington. Nevins said he’s been thinking about the show’s high profile in a volatile world in the context of the massive cyber-attack by North Korea that has created so much turmoil for Sony Pictures Entertainment during the past month.

“What’s happening with Sony is scary and depressing,” Nevins said. “As somebody who makes shows that try to engage in the world and occasionally take controversial stands, I have enormous sympathy and frustration about everything that Sony is having to deal with right now.”