America’s military misadventures in Iraq and Afghanistan remain deeply unpopular with the general public, but that pessimism isn’t preventing war films such as “American Sniper” and “Lone Survivor” from becoming box office successes.

“American Sniper,” a look at Navy SEAL Chris Kyle, astounded in its wide-release debut, and is on track to gross $105 million over the Martin Luther King holiday weekend. The Warner Bros. release put up those impressive numbers by appealing to a politically and geographically diverse audience.

“It’s packing them in across blue states and red states,” said Dan Fellman, Warner Bros. domestic distribution chief. “Its’ playing well in big cities and in the heartland. This is about patriotism and all the things people say the country is lacking these days.”

“American Sniper’s” commercial success stands in stark contrast to films released at the height of the conflict such as “In the Valley of Elah,” “Green Zone” and “Stop-Loss.” These pictures questioned the wars themselves and the impact they were having on American soldiers, with disastrous financial results. Even a best picture Oscar win for 2008’s “The Hurt Locker” couldn’t help that portrait of an Iraq War bomb squad member find much of an audience.

If anything, the country has turned more sharply against the wars in the ensuing years. A recent Pew Research survey revealed that roughly half of Americans believe U.S. had failed to achieve its goals in Iraq, a 19-point increase since 2011. Moreover, the rise of ISIS, the Islamist militant group with a penchant of broadcasting its executions on social media, and the tenuous political situation in Afghanistan have only exacerbated the sense that the wars fought to transform the Middle East have only resulted in more bloodshed and unrest.

So what changed on the film front?

Part of the shift in taste may be attributable to the passage of time and the fact that troop levels in both countries are a shadow of their former selves. In the case of previous unpopular wars, such as Vietnam, many of the most lasting and successful depictions of that conflict, like “Platoon” and “The Deer Hunter,” hit theaters years after hostilities had ended.

“The genre is working, because we have some distance beween us and the wars we’ve been involved in,” said Jeff Bock, a box office analyst at Exhibitor Relations. “When the war was at its height, nobody wanted to be in it and nobody wanted to watch films about the war. Now that things have died down there’s a different perspective and a chance to think.”

Part of what works in “Lone Survivor,” “American Sniper,” and “Zero Dark Thirty,” Kathryn Bigelow’s 2012 account of the hunt for Osama Bin Laden, is that the films were more interested in plot than polemics. Rather than try to make explicit points about politics, they focused on individual tales of triumph.

It’s not that these films are jingoistic. Director Clint Eastwood has criticized the war at screenings for “American Sniper” and the film does offer a stark portrait of the psychological damages that combat can cause. Likewise, “Zero Dark Thirty” presents an ambiguous portrait of the country’s relationship to torture, and the mission at the center of “Lone Survivor” results in casualties and ambiguous results. But many of the central characters are seen accomplishing extraordinary things. War may be hell, but it is not without heroism.

“These were truly American stories that resonate,” said Paul Degarabedian, senior media analyst with Rentrak. “They dramatize the tremendous valor of many of the wars’ participants.”

The studios behind these films also don’t shy away from emphasizing the action and flag-waving elements in their marketing materials. A poster for “American Sniper” prominently displays an American flag in the foreground, and the film’s initial trailer focused on star Bradley Cooper as he prepared to fire on an Iraqi carrying an IED.

“If they had played up too much of the drama, I doubt they’d have been as successful,” said Phil Contrino, vice president and chief analyst at BoxOffice.com.

This potent combination of patriotism and valor helped broaden the base of ticket-buyers.

“It’s expanding the audience,” said Greg Foster, CEO of Imax Entertainment, the wide-screen company that showed the film last weekend. “People who don’t traditionally go see Imax movies are coming to this.”

While the wars in Iraq and Afghanistan remain unpopular, the men and women who waged them are still held in high regard. A Pew survey from 2013, for instance, found that the military still tops the list of occupations in terms of the public’s esteem, with more than three-quarters of U.S. adults believing that those in the armed service contribute to society’s well-being.

“American Sniper” isn’t about George W. Bush or Barack Obama. It’s doesn’t focus on the generals and the politicians who advocated for war or called the shots. It’s concerned with the people who sacrificed and believed in America despite its foibles and failures.

“It gives better insight than any movie ever made about what these soldiers and servicemen do for us and what they go through not only on the battlefield, but in their personal lives,” said Fellman.

That’s something both Democrats and Republicans can get behind.