Acting Defense Secretary Patrick Shanahan had a message for the White House: Politics and the military don't mix.

Shanahan and Navy officials have faced intense scrutiny over a White House request to hide the USS John S. McCain warship during President Donald Trump's visit to Japan last month - a moment, among others, some defense officials and analysts have said is a sign of decay in the civilian-military relationship, which has been traditionally immune to partisan rancor.

Amid the backlash, Shanahan directed his chief of staff to tell the White House not to put the military in political situations, Shanahan's spokesman, Lt. Col. Joseph Buccino, told The Washington Post.

The Navy confirmed Saturday that it received a request from the White House to "minimize the visibility" of the ship.

But Vice Adm. Phillip Sawyer, commander of the 7th Fleet, squashed any potential effort to "put the ship out of sight" a day or two before Trump's visit over Memorial Day weekend, a senior Navy official told The Post on Sunday, speaking on the condition of anonymity to discuss the sensitive matter.

The request was apparently made to avoid angering Trump.

"I was not a big fan of John McCain in any shape or form," Trump said last week. "Now, somebody did it because they thought I didn't like him, OK? And they were well-meaning."

That an intervention by a senior commander was needed may have led Shanahan to consider formal guidance to avoid political entanglements in the future. Defense officials said Shanahan is weighing directives that bring clarity to how the military should support VIP visits and how to handle direct requests from the White House, the Associated Press reported.

Loren DeJonge Schulman, a former defense official with the Obama administration, said that Shanahan has the right instinct, but that the issue of military officials acquiescing to the White House could reveal deeper issues.

"If Shanahan cares about politicization risks, he should feel very uncomfortable that he was not informed about this request before it went public," said Schulman, now a defense analyst at the Center for a New American Security.

White House spokesman Hogan Gidley declined to address questions about the request. Acting White House Chief of Staff Mick Mulvaney on Sunday shrugged off the controversy, playing down the apparent intrusion of politics into military affairs.

Mulvaney was asked about the flap on NBC's "Meet the Press" and said that he thought the request probably was made by a young administration staffer and said that it was "not an unreasonable thing," given the commander in chief's well-known antipathy toward John McCain.

"The fact that some 23- or 24-year-old person on the advance team went to that site and said, 'Oh my goodness, there's the John McCain. We all know how the president feels about the former senator, and maybe that's not the best background. Could someone look into moving it?' That's not an unreasonable thing to ask," Mulvaney said.

It is not clear who within the White House made the request or whether any Navy commanders took steps to comply before Sawyer's intervention. Shanahan said the Pentagon will not investigate the matter, The Associated Press reported.

The ship was named after the father and grandfather of the late Sen. John McCain, R-Ariz., and rededicated last year to include the senator. Shanahan told reporters he spoke with McCain's widow, Cindy McCain, about the incident amid Trump's continued criticism of the former war prisoner and staunch critic of his administration.

McCain, a Vietnam prisoner of war who underwent torture at the hands of his captors, died of brain cancer in 2018.

Analysts and officials have expressed concern about how Trump's style - appearing before apolitical military audiences to deliver decidedly political messages and courting them as supporters - has broken with efforts to maintain separation between the military and politics.

In other instances, Trump has attacked Democrats, talked about immigration and his proposed border wall - a central campaign issue - and blasted his own chain of command as uniformed personnel stood around him.

Those types of events, where troops may applaud their commander in chief, run the risk of appearing to voters as an endorsement, said Rep. Ruben Gallego, D-Ariz., a former Marine and member of the House Armed Services Committee.

"When you have the president go to events like this, it looks like a junta," Gallego told The Post. Civilian control of the military dates back to George Washington, and a clear separation allows the military to avoid any appearance of influence over domestic political issues, he said.

Phil Carter, a senior researcher at the Rand Corp. who studies the civilian-military relationship, said even small displays of partisanship could endanger the balance.

"In a political system where power shifts among parties and leaders every 2 or 4 years, both in Congress and the White House, such mistrust can introduce dangerous instability into national security decision-making," Carter said in an email.

The Navy's top officer, Adm. John Richardson, reaffirmed the partition in the wake of the McCain incident.

"Part of this trust and confidence that we have not only up and down the chain of command, but also just as importantly with the American people, is that we do support and defend the Constitution of the United States," he said.

"We are apolitical by nature, and so that needs to be maintained."

Meanwhile, partisan comments amid a splash of military imagery has filtered down to the president's son. Donald Trump Jr., a top campaign surrogate, appeared on "Fox and Friends" last month during Fleet Week in New York City.

Hosts aboard the USS New York asked Trump Jr. about the special counsel investigation into Russian interference in the 2016 presidential campaign. "The Democrats are not dealing in good faith, we know that," he said, as more than a dozen sailors and Marines looked on.

This article was written by Alex Horton, a reporter for The Washington Post.