Officers were told to keep a warship named for the late Sen. John McCain out of President Trump's view during his Memorial Day weekend visit to Japan, CBS News has confirmed.

CBS News senior national security correspondent David Martin reports that a U.S. Indo-Pacific Command official wrote an email to Navy and Air Force officials before Mr. Trump's arrival. 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 first obtained by The Wall Street Journal. The Washington Post and Associated Press also confirmed its existence.

Get Breaking News Delivered to Your Inbox

Three U.S. officials spoke Wednesday to the AP on condition of anonymity because they were not authorized to discuss private email correspondence.

The Washington Post's Josh Dawsey tweeted late Wednesday that, "Admin officials confirm WSJ story. Request was made to make sure McCain ship wasn't visible. Aides say Trump wasn't involved in request — but it was made to prevent any potential ire from POTUS."

The USS John S. McCain conducts a patrol in the South China Sea on Jan. 22, 2017, while supporting security efforts in the region. Navy Petty Officer 3rd Class James Vazquez

The Journal reported that, 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 official said he would talk to the White House Military Office to get more information about the directive, the Journal said.

In response to the story, Mr. Trump - who feuded with McCain publicly for years and at one point 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."

The president notably does not say that he was not informed about the ship before his visit. A message seeking clarification was left late Wednesday for White House press secretary Sarah Sanders.

The president again denied the reports on Thursday, telling reporters at the White House firmly that he was "not involved" in the decision-making process.

"I would not have done that. I was not a big fan of John McCain in any way shape or form. To me John McCain, I wasn't a fan. But I would never do a thing like that. Now, someone did it because they thought I didn't like him. They were well-meaning, I will say. But I wouldn't have," Mr. Trump said.

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 Journal reported that a tarp was placed over the USS John S. McCain's name before Mr. Trump's arrival, according to photos it reviewed, and that sailors were instructed to remove any coverings from the ship that included its name.

The Navy's Chief of Information, Rear Admiral Charlie Brown, tweeted Wednesday night that, "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 Pacific Fleet spokesperson confirmed to CBS News that, "The picture of the tarp is from Friday and it was taken down on Saturday. All ships remained in normal configuration during the President's visit."

Martin says the McCain's commanding officer was on the ship on Saturday and the tarp was gone. "The admiral in command of the 7th Fleet, Adm. Bill Sawyer, is credited with directing that nothing would be covered up," Martin adds.

Two U.S. officials told the AP that all the ships in the harbor were lined up for Mr. 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 Mr. Trump's view of the ship, the officials said the tarp had been placed on the ship for maintenance and removed for the visit.

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 Mr. 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 Mr. Trump visited.

Sailors from McCain were given the day off, Martin reported. He said there was "no reason to disbelieve the sailors who say they were wearing McCain ballcaps and were turned away, but it is possible the reason they were turned away is that ball caps were not part of the dress code for the event."

Two U.S. officials told the AP that sailors on the ship 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.

Mr. Trump and McCain had a frosty relationship and that continued, on Mr. 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 Mr. Trump's skin by saying he had "fired up the crazies" at a rally in Phoenix. Mr. 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 Mr. Trump took office, McCain established himself as a leading critic, opposing Mr. 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.

Mr. 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 Mr. Trump will "always be deeply threatened by the greatness of my dads incredible life."

She added, "There is a lot of criticism of how much I speak about my dad, but nine months since he passed, Mr. Trump won't let him RIP. So I have to stand up for him.

"It makes my grief unbearable."

She later addressed the controversy on air on ABC's "The View" on Thursday, saying the "president's actions have consequences."

"When you repeatedly are attacking my father and war heroes it creates a culture in the military where people are clearly fearful to show my father's name," McCain said. "That's what started this again … if you're afraid to have a hat or show the name of the warship which is named after my grandfather, who was an officer in the Navy."

The USS John S. McCain is named for the late senator and his father and grandfather, who were both Navy admirals.

The destroyer was involved in a 2017 collision that took the lives of 10 crew members and, the Reuters news service reports, is currently undergoing repairs.