President-elect Donald Trump is assembling a national security team dominated by retired generals who share a deep distrust of Iran and have characterized the threat of militant Islam in far more dire terms than Obama administration officials and intelligence assessments.

The trio of ex-generals represents an emerging core of the Trump administration that is at odds with President Obama’s efforts to convince the American public that — 15 years after the Sept. 11, 2001, attacks — terrorism continues to pose a persistent threat to the nation, but not an existential one.

The generals’ views also cut against the grain of U.S. policies seeking to empower moderates in Iran and of U.S. intelligence assessments that terrorism no longer stands alone atop the rankings of global security threats now crowded by concerns about cyberattacks and renewed aggression by China and Russia.

Their views, though far from uniform, have been heavily influenced over the past 15 years by intensely personal battlefield losses, the country’s waning attention to the wars and an up-close view of a ruthless enemy.

Those experiences could lead retired Gens. Michael T. Flynn, James N. Mattis and John F. Kelly to urge caution in Trump administration debates about the use of force. But former colleagues and experts said the generals are also more likely, by virtue of their training and experience, to see malign intent or view the world as a struggle between good and evil.

President-elect Donald Trump has already tapped three former generals to serve in his administration. The Washington Post's Jenna Johnson explains what attracts Trump to these men. (Bastien Inzaurralde/The Washington Post)

[How Trump naming Mattis as Pentagon chief would break with 65 years of U.S. history]

“The nature of the job in the military is to be responsible for threats against the nation and to be blamed if the country is not prepared,” said Stephen Biddle, a professor at George Washington University and frequent adviser to the U.S. military in Iraq and Afghanistan. “They tend to be very threat-focused in relation to civilians and tend to see that threat in more apocalyptic terms.”

Statements and online postings by Flynn, Trump’s choice for national security adviser, have drawn the most alarm among intelligence analysts and the foreign-policy establishment.

“We’re in a world war, but very few Americans recognize it, and fewer still have any idea how to win it,” Flynn wrote in his recent book “The Field of Fight.” He has also repeatedly depicted Islam as a diseased religion that represents a growing danger. “Fear of Muslims is rational,” he wrote in a posting to his Twitter account earlier this year.

[Trump’s security pick brings experience and controversy]

Mattis and Kelly — Trump’s respective nominees for secretary of defense and secretary of homeland security — have been far more measured in their foreign-policy pronouncements and are widely respected within the foreign-policy establishment and among the United States’ Gulf Arab allies. Yet each has expressed hard-line views about Iran and the threat of terrorism.

“Our country today is in a life-and-death struggle against an evil enemy, but America as a whole is certainly not at war,” Kelly said in late 2010, just days after his son, an officer leading Marines in Afghanistan, was killed. “Not as a country. Not as a people.”

Mattis’s persistent warnings about the threat posed by Iran led to tensions with the White House, which urged him when he was in uniform to tone down his rhetoric. He has criticized the Obama administration for taking too passive an approach to Iranian aggression and fostering “the impression in the region that the U.S. was withdrawing.”

In a speech in April, Mattis described the Iran deal as one “drawn up with the expectation that Iran will cheat.” He said that one of its principal advantages would be that “we’ll have better targeting data should it come to a fight at some point in the future.”

“We’re going to have to plan for the worst,” Mattis said.

Obama has mounted an aggressive campaign to kill senior al-Qaeda and Islamic State leaders and wrest back territory seized by the extremists in Iraq and Syria. But he has also emphasized that the groups are not “the vanguard of a new world order.”

“These terrorists can never directly destroy our way of life, but we can do it for them if we lose track of who we are and the values that this nation was founded upon,” the president said in a speech earlier this week.

[ISIS’s second-in-command hid for months in Syria. When he stepped out, the U.S. was waiting.]

The three generals also share a widely held frustration in the military that they have been fighting for 15 years without the full support of the country or its civilian leaders.

“All of us who served and fought in Iraq and Afghanistan, month after month, year after year, have been too close to the human costs — our buddies killed in action and our Iraqi and Afghan partners assassinated,” said J. Kael Weston, a State Department official who advised Marine officers in Iraq and Afghanistan and wrote “The Mirror Test,” a memoir of his service. “But the policymakers in D.C. have been too far removed from the blood-red tally of war.”

When Mattis retired from the Marines in 2013, he spent two weeks zigzagging across the country visiting the parents of Marines killed under his command. Kelly and his two sons have taken part in more than a dozen combat tours in Iraq and Afghanistan. When his son’s platoon was deployed to Afghanistan in 2010, he made weekly and sometimes daily trips to visit his son’s wounded Marines at Walter Reed National Military Medical Center in Bethesda, Md. Those trips continued after his son was killed in combat.

Flynn, who served in Afghanistan and as the Joint Special Operations Command’s senior intelligence officer, has spent as much time deployed to war zones as almost any other general in the Army over the past 15 years.

The disconnect between the generals and Washington also extended to the battlefield, where military officers often felt compelled to describe the messy wars to their troops as battles between good and evil.

“When you explain to a lance corporal why his best friend got horribly killed and he has to go out there again and again and again, you don’t have time for geo­politics,” said retired Lt. Col. John Nagl, an Iraq veteran and counter­insurgency expert. “You tell him, ‘We have to fight the enemy here so that we don’t have to fight them at home.’ ”

A big question is how the perspectives of senior military officers, serving in Cabinet-level positions, will influence the direction of a Trump administration.

Obama’s deep skepticism of foreign intervention meant that he often served as a brake on discussions about how the United States might respond to hostile developments overseas. Trump has no foreign-policy or military experience to examine for insights into how he might respond, but his campaign posture was animated mainly by the promise of aggression.

“I think it’s likely there will be terrorist attacks in the coming years, and I think Trump will feel tremendous pressure to be seen as acting very decisively,” said Dan Byman, a former Middle East analyst at the CIA and a professor at Georgetown University.

Trump’s advisers may be quicker to see nefarious intent because of their military experience, he said, but be more cautious about U.S. military intervention or retaliation.

Byman cited the example of the Iranian seizure of American sailors shortly before the Iran nuclear deal was signed as an example of an overseas provocation that had the potential to derail broader U.S. policy goals.

Trump’s advisers “have a lot of personal experience and might be more inclined to see Iranian hostility as deeply planned,” rather than the act of a rogue faction or a function of chaos, Byman said. “They’re more likely to read things negatively than the Obama administration would have.”

“In significant ways, the chances for limited conflict with Iran go up,” Byman said. “But that doesn’t mean, to me, we bomb them.”

Read more:

Designated national security adviser and his son are among those pushing Clinton conspiracy theory

Obama administration releases memo outlining use of force rules

What Trump may not know about the generals he’s eyeing for top positions