Defense Secretary Jim Mattis speaks with crew members from the U.S. Navy’s Ohio-class ballistic missile submarine USS Kentucky at Naval Base Kitsap, in Bangor, Wash., Aug. 9, 2017. (DOD photo by U.S. Air Force Staff Sgt. Jette Carr)

Defense Secretary Jim Mattis met with sailors serving on the submarine USS Kentucky last week in his home state of Washington, praising them for their sacrifices and expressing concern that he has “grown remote from those of you who matter.” Then he noted the up-and-down nature of military life, told the sailors that they’ll miss being in the Navy after they leave — and issued an off-color compliment.

“You’ll miss it like the dickens, and you’ll be changed for the better for the rest of your life,” said Mattis, who retired as a four-star Marine general in 2013. “So you’ll never regret, but you will have some of the best days of your life and some of the worst days of your life in the U.S. Navy, you know what I mean? That says — that means you’re living. That means you’re living. That means you’re not some p—- sitting on the sidelines, you know what I mean, kind of sitting there saying, ‘Well, I should have done something with my life.’ ”

He continued: “Because of what you’re doing now, you’re not going to be laying on a shrink’s couch when you’re 45 years old, say[ing] ‘What the hell did I do with my life?’ Why? Because you served others; you served something bigger than you.”

The vulgar, full-throated defense of military service was delivered to a crew that returned in June to Naval Base Kitsap-Bangor from a deployment at sea. It also left the Pentagon with a quandary: Should it edit the transcript of the Aug. 9 appearance, which was attended by a handful of journalists but not reported on in detail? Or, should it release the full transcript as usual, even though Mattis’s salty comments may create a stir or offend?

It took a couple days, but the Defense Department has now released the unedited transcript, and it generated both positive and negative attention Tuesday on social media.

Dana White, a spokesman for Mattis, described the exchange with the sailors as an example of the secretary’s “unique way of connecting with his audience.”

Asked why it took so long for the Defense Department to post the transcript, she blamed logistics.

“We try to get the transcripts up as soon as possible, but that’s not always possible when traveling,” she said.

At a congressional luncheon after his swearing in on Jan. 20, President Trump briefly spoke about his Cabinet. "I see my generals," he said. "These are central casting. If I'm doing a movie, I'd pick you general, General Mattis." (The Washington Post)

Mattis, who is beloved by many service members and veterans and sailed through his confirmation process, had a history of brash comments as a general officer, earning a rebuke in 2005 from then-Commandant Gen. Michael Hagee after a remark in front of an audience in San Diego.

“You go into Afghanistan, you got guys who slap women around for five years because they didn’t wear a veil,” he said at the time. “You know, guys like that ain’t got no manhood left anyway. So it’s a hell of a lot of fun to shoot them. Actually, it’s a lot of fun to fight. You know, it’s a hell of a hoot. It’s fun to shoot some people. I’ll be right upfront with you, I like brawling.”

But as defense secretary, his use of the “p—-” term is troubling, said retired Col. Don Christensen, a former chief prosecutor in the Air Force who is now president of Protect Our Defenders, an organization that advocates for men and women who have been sexually assaulted in the military. That issue remains a problem in the Armed Forces, and includes a scandal this year in which the nude photographs of hundreds of  women were shared through a without their consent through a Facebook group called Marines United.

Channeling salty icons like Army Gen. George S. Patton “has its place,” but the term Mattis used “clearly implied that those who don’t serve are less manly than those who do,” Christensen said.

“It just sends the wrong message to the 15 percent of the military who are women,” he said. “As secretary of defense, he’s just got to be more careful about the words he uses, especially around troops who in some cases worship him.”

Retired Navy Capt. Lory Manning, a fellow with the nonprofit Service Women’s Action Network, said that she in general agrees with the sentiments Mattis expressed, but considering the Marines United scandal, the sense that the Marine Corps reluctantly integrated women into ground combat roles and “the common usage of the word ‘p—- as a sexual slur,” she found his use of the word “to be a bizarre and offensive choice.”

Mattis’s comments as secretary have typically been measured, but there have been exceptions. In May, he was asked in a television interview with CBS News what keeps him awake at night, and he responded in deadpan fashion.

“Nothing,” Mattis replied. “I keep other people awake at night.”

In his meeting with sailors, Mattis also defended the need for the United States to stay engaged with the rest of the world, and not become isolationist — something nationalist parts of the Trump administration advocate. Then he made a joke about the lurking threat that the birds overhead posed to the sailors’ uniforms.

“All right, listen, you guys have had enough time standing underneath these seagulls,” he said. “I’ve been a little worried here for a minute, you know?”