US Defense Secretary Jim Mattis arrives at Forward Operating Base Gamberi east of Kabul, Afghanistan, on an unannounced visit to the war-torn country on September 27, 2017.

On a summer morning in a desolate corner of Iraq's western desert, Jim Mattis learned he'd narrowly evaded an assassination attempt.

A Sunni Arab man had been caught planting a bomb on a road shortly before Mattis and his small team of Marines passed by. Told the captured insurgent spoke English, Mattis decided to talk to him.

After Mattis offered a cigarette and coffee, the man said he tried to kill the general and his fellow Marines because he resented the foreigner soldiers in his land. Mattis said he understood the sentiment but assured the insurgent he was headed for Abu Ghraib, the infamous U.S.-run prison. What happened next explains the point of the story.

"General," the man asked Mattis, "if I am a model prisoner do you think someday I could emigrate to America?"

In Mattis' telling, this insurgent's question showed he felt "the power of America's inspiration." It was a reminder of the value of national unity.

Mattis, now the Pentagon boss and perhaps the most admired member of President Donald Trump's Cabinet, is a storyteller. And at no time do the tales flow more easily than when he's among the breed he identifies with most closely — the men and women of the military.

The anecdote about the Iraqi insurgent, and other stories he recounted during a series of troop visits shortly before Christmas, are told with purpose.

"I bring this up to you, my fine young sailors, because I want you to remember that on our worst day we're still the best going, and we're counting on you to take us to the next level," he said. "We've never been satisfied with where America's at. We're always prone to looking at the bad things, the things that aren't working right. That's good. It's healthy, so long as we then roll up our sleeves and work together, together, together, to make it better."

The stories tend to be snippets of Mattis' personal history, including moments he believes illustrate the deeper meaning of military service.

On a trip last month to the U.S. Navy base at Guantanamo Bay, Cuba, and three domestic military installations, Mattis revealed himself in ways rarely seen in Washington, where he has studiously maintained a low public profile. With no news media in attendance except one Associated Press reporter, Mattis made clear during his troop visits that he had not come to lecture or to trade on his status as a retired four-star general.

"Let's just shoot the breeze for a few minutes," he said at one point.

Another time he opened with: "My name is Mattis, and I work at the Department of Defense."

Mattis used stories to emphasize that today's uncertain world means every military member needs to be ready to fight at a moment's notice.

He recalled the words of a Marine sergeant major when Mattis was just two years into his career:

"Every week in the fleet Marine force is your last week of peace," the sergeant major said. "If you don't go into every week thinking like this, you're going to have a sick feeling in the bottom of your stomach when your NCOs (non-commissioned officers) knock on your door and say, 'Get up. Get your gear on. We're leaving.'"

By leaving, Mattis meant departing for war.

A recurring Mattis theme is that the military operates in a fundamentally unpredictable world. He recalled how he was hiking with his Marines in the Sierra Nevadas in August 1990 when he got word to report with his men to the nearest civilian airport. Iraq's Saddam Hussein had just invaded Kuwait, and the Marines were needed to hold the line in Saudi Arabia.

In an exchange with Marines at Camp Lejeune, North Carolina, Mattis recalled sitting in the back of a room at the Pentagon in June 2001 while senior political appointees of the new George W. Bush administration fired questions at a military briefer about where they should expect to see the most worrisome security threats. At one point, Mattis said, the briefer said confidently that amid all the uncertainty, the one place the U.S. definitely would not be fighting was Afghanistan.

"Five and a half months later, I was shivering in Afghanistan," Mattis said, referring to his role as commander of Task Force 58, a special group that landed in southern Afghanistan aboard helicopters flown from Navy ships in the Arabian Sea to attack the Taliban in and around Kandahar.

Regardless how much they resonate with his young audience, Mattis' stories illustrate how he sees his military experience as a way to connect with troops who often feel distant from their political leaders. They also are a reminder Mattis' boss is one of the most politically divisive figures in recent history.

Speaking to troops and family members at an outdoor movie theater at Guantanamo, Mattis pointed directly to the political battles.

"I'm so happy to be in Guantanamo that I could cry right now, to be out of Washington," he said, adding jokingly that he wouldn't mind spending the rest of his tenure away from the capital. He said as soon as he gets back in the company of uniformed troops, he is reminded of why the military can set a standard for civility.

"Our country needs you," he said, and not just because of the military's firepower. "It's also the example you set for the country at a time it needs good role models; it needs to look at an organization that doesn't care what gender you are, it doesn't care what religion you are, it doesn't care what ethnic group you are. It's an organization that can work together."