"There was a lower level effort to comply with the request but when leadership became aware they ordered the tarp be taken down," a U.S. Navy official told ABC News in reference to a tarp over the name of the ship. "Navy leadership decided the name should not be obscured."
As first reported Wednesday by The Wall Street Journal, a U.S. Indo-Pacific Command official wrote an email to Navy and Air Force officials about Trump's arrival in Japan over Memorial Day weekend. It included instructions for the proper landing areas for helicopters and preparations for the USS Wasp , the ship on which the president was to speak.
The official then issued a third instruction: "USS John McCain needs to be out of sight," according to the email, which was obtained by the Journal and whose existence was confirmed to The Associated Press.
The three U.S. officials spoke Wednesday to the AP on the condition of anonymity because they were not authorized to discuss private email correspondence.
When a Navy commander expressed surprise at the instruction, the U.S. Indo-Pacific Command official answered, "First I heard of it as well," the Journal reported. The official said he would talk to the White House Military Office to get more information about the directive, the newspaper reported.
In response to the story, Trump - who feuded with McCain publicly for years and mocked his military service - tweeted that he "was not informed about anything having to do with the Navy Ship USS John S. McCain during my recent visit to Japan."
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!— Donald J. Trump (@realDonaldTrump) May 30, 2019
The president notably does not say that he was not informed about the ship before his visit to Japan. A message seeking clarification was left late Wednesday for White House press secretary Sarah Sanders.
In Jakarta, Indonesia, on Thursday morning, Acting U.S. Defense Secretary Patrick Shanahan told reporters, "When I read about it this morning, it was the first I heard about it."
He later told reporters traveling with him to a security conference in Singapore that he would ask his chief of staff to look into the reports.
"I never authorized, I never approved any action around the movement or activities regarding that ship," Shanahan said.
He said he would never dishonor the memory of a great American like McCain or disrespect the young men and women in the crew of the ship.
Asked about service members getting involved in political situations, Shanahan said the military "needs to do their job" and stay out of politics.
The Wall Street Journal reported that a tarp was placed over the USS John S. McCain's name before Trump's arrival, according to photos it reviewed, and that sailors were instructed to remove any coverings from the ship that included its name.
U.S. Navy Cdr. Clay Doss, spokesman for U.S. 7th Fleet, told the AP that the tarp was on the ship on Friday but was removed by Saturday morning, the day Trump arrived.
"All ships remained in normal configuration during the President's visit," he said.
Two U.S. officials told the AP that all the ships in the harbor were lined up for Trump's visit, and they were visible from the USS Wasp. The officials said, however, that most of their names probably could not be seen since they were side by side but that the name of the USS John S. McCain could be seen from the pier.
Asked if the tarp was meant to block Trump's view of the ship, the officials said the tarp had been placed on the ship for maintenance and removed for the visit.
Rear Adm. Charlie Brown, Navy public affairs officer, 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."
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.— Navy Chief of Information (@chinfo) May 30, 2019
The ship was originally named after the late senator's father and grandfather. A month before the senator's death last year, the Navy ordered that the ship's name would also honor Sen. McCain.
Two U.S. officials said a paint barge was in front of the USS John S. McCain on Saturday morning when 7th Fleet officials walked the pier to see how everything looked for the visit. The barge was then ordered to be moved and was gone by the time Trump arrived, the officials said.
The Journal reported, based on people familiar with the matter, that sailors on the USS John S. McCain, who usually wear hats with the ship's name on it, were given the day off when Trump visited.
Two U.S. officials told the AP that sailors on the USS John S. McCain were not told to stay away but that many were away for the long weekend. The officials also said that about 800 sailors from more than 20 ships and Navy commands were on the USS Wasp during the president's visit, and all wore the same Navy hat that has no logo, rather than wearing individual ship or command hats.
Trump and McCain had a frosty relationship and that continued, on Trump's part, even after McCain died in August 2018 of brain cancer.
In 2015, McCain, a Republican senator from Arizona, had gotten under then-candidate Trump's skin by saying he had "fired up the crazies" at a rally in Phoenix. Trump, also a Republican, later told a crowd in Iowa that McCain was only a war hero "because he was captured. I like people who weren't captured."
After Trump took office, McCain established himself as a leading critic, opposing Trump's immigration-limiting order, warning him against coziness with Moscow and lecturing him on the illegality of torture. The senator incensed the president with his thumbs-down vote that foiled the president's efforts to repeal President Barack Obama's health care law.
Trump was not welcome at McCain's funeral and raised the White House's U.S. flag back to full-staff shortly after McCain's death, despite U.S. Flag Code stating that it should remain at half-staff for another day. The flag returned to half-staff later in the day.
McCain's daughter Meghan tweeted Wednesday that Trump will "always be deeply threatened by the greatness of my dads incredible life."
Trump is a child who will always be deeply threatened by the greatness of my dads incredible life. 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.— Meghan McCain (@MeghanMcCain) May 30, 2019
It makes my grief unbearable. https://t.co/gUbFAla1VE
She added, "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."
ABC News and the ABC Owned Television Stations contributed to this report.