Shortly after the Wall Street Journal broke the story, Trump tweeted that he wasn't involved.
"I was not informed about anything having to do with the Navy Ship USS John S. McCain during my recent visit to Japan. Nevertheless, @FLOTUS and I loved being with our great Military Men and Women - what a spectacular job they do!" he wrote.
The Journal reported that Acting Defense Secretary Pat Shanahan knew of the White House's concerns and approved military officials' efforts to obscure it from view.
The US Navy reportedly went to great lengths to shield Trump from seeing the ship. Officials told the Journal they first covered it with a tarp, then used a barge to block the name and gave the sailors on the ship the day off, the Journal reported.
Cmdr. Nate Christensen, a Navy spokesman, said that images of the tarp covering the ship are from Friday, and it was taken down Saturday.
"All ships remained in normal configuration during the President's visit," he said in an email, challenging the suggestion that a barge was moved to block it.
The Navy's one-star admiral in charge of public affairs, Rear Adm. Charles Brown, also tweeted Wednesday night: "The name of USS John S. McCain was not obscured during the POTUS visit to Yokosuka on Memorial Day. The Navy is proud of that ship, its crew, its namesake and its heritage."
A Navy official, speaking on the condition of anonymity due to the sensitivity of the issue, said that the McCain's crew was not present at the visit, but it was because they and the crew of another vessel, the USS Stethem, had been released by their commanders to take a break on the long Memorial Day weekend.
Before John McCain's death in August 2018, the US Navy added the senator's name to the ship, already named the USS John McCain after his father and grandfather, both admirals. The ship is stationed in Japan, where it's being repaired after a fatal crash in 2017.
Trump has continued to speak ill of the late senator in his public remarks and on social media. Meghan McCain, who is quick to come to her father's defense, immediately blasted Trump on Twitter.
"Trump is a child who will always be deeply threatened by the greatness of my dads incredible life," Meghan McCain tweeted. "There is a lot of criticism of how much I speak about my dad, but nine months since he passed, Trump won't let him RIP. So I have to stand up for him. It makes my grief unbearable."
Mark Salter, McCain's longtime speechwriter and co-author, tweeted, "Perhaps the late Senator's Armed Services Committee colleagues will have questions about this for the acting SecDef, whose confirmation ought to be in jeopardy."
Trump began attacking McCain during the presidential campaign when he said McCain wasn't a war hero because he'd been captured. McCain was a prisoner of war in Vietnam for more than five years.
The president also blames McCain for voting against a Republican plan to repeal the Affordable Care Act. Trump often says the law would be gone if not for McCain, which isn't true.
McCain did not want Trump at his funeral, but his presence was felt in the eulogies past presidents and friends gave. Meghan McCain offered the most direct rebuke of the current president, using his campaign slogan as a not-so-veiled dig.
"The America of John McCain has no need to be made great again because America was always great," she said in her eulogy for her father.