WASHINGTON — When Defense Secretary James N. Mattis declared last month that he had “no plans” to cancel future joint military exercises with South Korean forces, it brought him a very public rebuke from President Trump.

“There is no reason at this time to be spending large amounts of money on joint U.S.-South Korea war games,” Trump fired back the next day in a tweet he labeled “Statement from the White House.” He underscored that only “the President” could restart the exercises he had abruptly suspended after his June summit with North Korean leader Kim Jong Un.

The dispute highlighted Mattis’ precarious standing with Trump. The president once reveled in the 68-year-old retired Marine general’s reputation as a battle-hardened warrior — calling him “Mad Dog,” to Mattis’ distress — but recently appears to have wearied of him.

Current and former Pentagon officials who have observed the relationship firsthand cite growing signs of discord that raise questions about how much longer Mattis, long seen as a steadying force in the Trump Cabinet, will remain at the Pentagon.

More than specific policy disagreements, the growing estrangement stems from Trump’s belief that Mattis is secretly dismissive of him and constantly trying to outmaneuver him, officials say.

“He thinks Mattis isn’t loyal in the way Trump wants all his people to be loyal — publicly, unquestioningly and completely,” said a national security official who has observed the relationship and spoke on condition of anonymity to discuss the sensitive topic.

On the other side, associates say Mattis’ frustration at Trump’s often impetuous style and penchant for blindsiding the Pentagon with major policy announcements could eventually prompt him to quit.

Once-frequent phone calls between the two after Trump took office last year have dwindled to occasional conversations. Policy clashes that once unfolded in private are increasingly surfacing publicly, often because Trump seems determined to send a message to Mattis that he is in charge.

They have been at odds over Trump’s demand to bar transgender recruits from the military, his call to create a new armed service called the “space force,” his verbal attacks on NATO allies, his suggestions that he may cut U.S. troop levels in Europe and Asia, and the timetable for removing U.S. troops from Syria.

National security advisor John R. Bolton’s hard-line approach to Iran and other issues meshes better with Trump’s disruptive instincts than Mattis’ often more strategic approach, according to the officials.

Asked Wednesday at the Pentagon to describe his relationship with Trump, Mattis replied, “No problem. It’s been the same all along.”

Pressed on whether he intended to serve out the rest of Trump’s first term, Mattis replied, “This is not a day I’m going to go further into politics,” and shortly thereafter ended the questions.

“Secretary Mattis is laser-focused on doing his job — ensuring the U.S. military remains the most lethal force on the planet,” Pentagon Press Secretary Dana W. White said Friday. “There is no daylight between the secretary and president when it comes to supporting our service members and their mission.”

Journalist Bob Woodward wrote in a book released Tuesday that Mattis had told associates that Trump had “a fifth- or sixth-grader” understanding of the challenge on the Korean peninsula, and that Mattis once disregarded a presidential directive to assassinate Syrian President Bashar Assad.

Mattis described the account as “fiction.” In a rare public defense of Trump, he said in a statement that the “contemptuous words about the President attributed to me in Woodward’s book were never uttered by me or in my presence.”

Trump responded that he was “very happy” with Mattis, and called his condemnation of the book “the nicest quote about me I think I’ve ever had.”

But in private, Trump has started referring to Mattis as “Moderate Dog,” a mocking reference to the nickname that Mattis disdains and to his attempts to rein in White House ideas, according to Politico.

Mattis was never a seamless fit with Trump.

He rose to top Pentagon and North Atlantic Treaty Organization commands in the last two decades with a reputation as a fierce battlefield commander. He was also known for his colorful quips, such as his advice to Marines in Iraq to “be polite, be professional, but have a plan to kill everybody you meet.”

Mattis’ swagger initially enthralled Trump. The president pushed Congress for a far bigger military budget and granted the Pentagon greater leeway to carry out airstrikes and counter-terrorism raids in the Middle East, Afghanistan and Africa without prior approval from the White House.

Trump had campaigned on the idea of unleashing the military to quickly defeat Islamic State militants in Iraq and Syria, and to end the long-running war in Afghanistan. His ideas resonated with a Pentagon that often chafed under tight restrictions imposed by the Obama administration.

As a four-star general at U.S. Central Command from 2010 to 2013, Mattis had sometimes-tense relations with Obama aides over his proposals to keep military pressure on Iran. That led to fears at the White House of an inadvertent clash just as President Obama was starting to seek a diplomatic deal to block Tehran from building a nuclear bomb.

The Iran nuclear deal was completed in 2015, but Trump announced last year that he was withdrawing from it.

When Obama had Mattis replaced at Central Command several months before his normal rotation was up, he learned about the decision from the media — a snub he bitterly resented, former officials say.

But having returned to the Pentagon as a civilian, Mattis has more often been the voice of military restraint, not the hard-liner he was seen as under Obama.

When Trump vowed massive reprisals against Syria in April for its use of chemical agents against civilians, Mattis and Gen. Joseph Dunford, chairman of the Joint Chiefs of Staff, provided a narrow target list that minimized the risk that Russian troops in Syria might be casualties of U.S. airstrikes, which could spark a wider war.

Mattis also has maneuvered Trump away from an abrupt withdrawal of the roughly 4,000 U.S. troops in eastern Syria.

He joined others on the national security team — Director of National Intelligence Dan Coats, Secretary of State Michael R. Pompeo and lately Bolton — in making an argument to Trump: If U.S. troops are pulled out too soon, Islamic State militants might recover and again threaten Iraq, strengthening Iran.

But Mattis has had to absorb Trump’s frustration at the lack of quick, highly visible military victories.

The tensions have taken a toll on Mattis’ relationship with Trump, some current and former officials say.

The Pentagon chief’s refusal to air differences with the White House in public has kept him mostly out of the crosshairs in Trump’s tweets. But his aversion to lavishing praise on Trump publicly the way other Cabinet members have has not gone unnoticed.

“Mattis is certainly operating on the less-is-more strategy when it comes to the White House,” said Derek Chollet, a senior official in the Obama administration who worked with Mattis. “It’s not surprising that to some extent he is losing altitude.”

Trump is fighting back against the Pentagon’s practice of slow-rolling or even ignoring White House ideas it opposes. Instead of fuming in private, Trump has staged public events aimed at forcing the Pentagon to get in line.

He did so last month at the Pentagon, where Vice President Mike Pence outlined the White House plan for creation of a space force, forcing Mattis, who had previously questioned the idea of a separate armed service for outer space, to backtrack.

“I was not against setting up a space force,” Mattis told reporters later. “What I was against is rushing to do that before we define those problems.”

Most of the Pentagon was blindsided when Trump abruptly announced, after meeting Kim in Singapore on June 12, that he was halting long-planned, large-scale military exercises with South Korea. Mattis knew Trump was considering the idea but had no advance warning he would do it, officials said.

At the Pentagon, officials again sought to contain the damage. They formally canceled only pending exercises, not those scheduled for next year, and emphasized that unit-level training was unaffected.

Previous presidents have temporarily suspended exercises as part of diplomatic outreach to North Korea. But for Mattis, the decision directly challenged one of his most deeply held beliefs — that American troops must be ready to fight at all times.

Privately, senior officials warned that the readiness of U.S. forces would be harmed if exercises do not resume by next spring, when a new U.S. commander and new military personnel will have rotated in to South Korea.

Even after Trump’s reminder that the president would decide whether to resume exercises, Mattis didn’t entirely back down. He issued his own pointed statement, repeating that “no decisions have been made about suspending any future exercises.”

david.cloud@latimes.com

Twitter: @davidcloudLAT