Documentary filmmaker Matthew Heineman talked about the daunting process of filming “Retrograde,” his latest effort that tells the story of the United States’ final months of its 20-year war in Afghanistan. On Variety’s Doc Dreams, presented by National Geographic the director explains how his focus eventually landed on following the three-star General Sami Sadat.

“By the time we started filming, it went from a portrait of a Green Beret deployment and humanizing that experience to, ‘Wow, actually, we can maybe tell the story of the end of the War in Afghanistan through the prism of this deployment,'” Heineman said. “When I was 21 years old, I heard a mentor of mine say, ‘If you end up with the story you started with then you weren’t listening along the way.’ Certainly, that was the case with ‘Retrograde.'”

Leader of the Afghanistan Army, Sadat was in the eye of the storm after President Joe Biden ordered the United States’ military forces to pull out from the country. Heineman followed Sadat for months, filming harrowing helicopter rides inundated with enemy fire and dangerous caravan rides where audiences can hear the sounds of explosions mere blocks away from Sadat’s vehicle.

As the violence escalated and grew closer to their crew, Heineman found he had to pivot again. The “Retrograde” crew was stuck outside of the country and by the time the Heineman found his way back inside Kabul, Sadat was forced to flee, effectively losing access to their primary subjects. “Once again we were were presented with a situation, ‘What is the story we’re telling?'” Heinman asked. “With every door that closes, another door opens. With every failure comes an opportunity. And the opportunity here was to open up the aperture, the storytelling, to show the civilians that the Green Berets were fighting for, to show the civilians that General Sadat and his men were fighting for.”

That meant turning the focus onto the people hoping to leave, a difficult task as the doors to the Kabul International Airport had closed, no one was getting through.

“I’ve filmed a lot of very sad things over the course of my career, and I’ve certainly cried on airplanes, in the edit room, or at film festivals, but I’ve never cried while filming,” Heineman said. “That scene at the Abbey Gate, as thousands of civilians were packed line sardines in a sewage ditch like four feet deep… as the Taliban was a hundred yards away watching us at gunpoint… I just had tears streaming down my face.”

This unique situation was one of the only times that compelled the documentarian to get involved. “At the Abbey Gate, we saw a translator that we knew on the other side of the divide, if you will, and we helped get them across and help get him on an airplane,” the director said. “I also wanted to get my Afghan field producers and translators out. We mobilized them and got them to the gate and got them through and their families. Honestly more so than the film itself, I’m most proud that we were able to get them out of the country, that they’re now safely in the US.”

Watch the full interview above.