President Donald Trump and his acting defense secretary distanced themselves Thursday from an order to keep a warship rededicated in honor of the late Sen. John McCain, a Trump thorn , out of sight during the commander in chief's recent visit to Japan.

The Pentagon's acting chief, Patrick Shanahan, said he never authorized attempts to make sure Trump would not see the USS John S. McCain at its homeport in Japan and would have his chief of staff investigate. Trump said he was not involved in the matter.

Trump, who long feuded with McCain , told reporters at the White House that he "was not a big fan" of the Arizona Republican and onetime presidential nominee "in any way, shape or form." But, Trump added, "I would never do a thing like that."

"Now, somebody did it because they thought I didn't like him, OK? And they were well-meaning, I will say," he said, while insisting he was kept in the dark.

The order that a Navy destroyer be kept out of sight reflected what appeared to be an extraordinary White House effort to avoid offending an unpredictable president known for holding a grudge, including a particularly bitter one against McCain.

Three U.S. officials confirmed to The Associated Press that the White House told the Navy to keep the warship named for McCain, his father and his grandfather out of Trump's sight during Trump's visit Tuesday to a base outside Tokyo.

The Wall Street Journal first reported that a U.S. Indo-Pacific Command official wrote an email to Navy and Air Force officials about Trump's Memorial Day weekend visit, including instructions for preparations for the USS Wasp, where he was to speak.

"USS John McCain needs to be out of sight," according to the email, obtained by the Journal and whose existence was confirmed to the AP by the three U.S. officials. They spoke 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.

Trump tweeted late Wednesday that he "was not informed about anything having to do with the Navy Ship USS John S. McCain during my recent visit to Japan."

Still, he added Thursday that he "was very, very angry with McCain because he killed health care. I was not a big fan of John McCain in any way, shape or form."

As a senator, McCain broke with the president in key areas. He incensed Trump with his thumbs-down vote foiling the effort to repeal President Barack Obama's health care law. Trump also mocked McCain's military service, which included years of imprisonment and torture during the Vietnam War.

The warship, commissioned in 1994, was originally named for the senator's father and grandfather, both Navy admirals named John Sidney McCain. Last year, the Navy rededicated the ship to honor the senator as well.

Shanahan told reporters in Jakarta, Indonesia, on Thursday that he had been unaware of the request about the USS John S. McCain.

"I never authorized, I never approved any action around the movement or activities regarding that ship," Shanahan said. He said the military "needs to do their job" and stay out of politics.

The Journal, citing photos it reviewed, reported that a tarp was placed over the USS John S. McCain's name before Trump's arrival and that sailors were instructed to remove any coverings from the ship that included its name.

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. 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 in Japan.

"All ships remained in normal configuration during the President's visit," he said.

Two U.S. officials told 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 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.

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." POTUS stands for president of the United States.

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 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 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 last August, 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."

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."

___

Associated Press writer Jill Colvin contributed to this report.