The White House asked Navy officials to obscure the USS John S. McCain while President Donald Trump was visiting Japan, Pentagon and White House officials said Wednesday night.

A senior Navy official confirmed he was aware that someone at the White House sent a message to service officials in the Pacific requesting that the USS John McCain be kept out of the picture while the president was there. That led to photographs taken Friday of a tarp obscuring the McCain name, said the official, who spoke on the condition of anonymity because of the sensitivity of the situation.

When senior Navy officials grasped what was happening, they directed Navy personnel who were present to stop, the senior official said. The tarp was removed on Saturday, before Trump's visit, he added.

The White House request was first reported by the Wall Street Journal.

The crew of the McCain also was not invited to Trump's visit, which occurred on the USS Wasp. But a Navy official, speaking on the condition of anonymity, said it was because the crew was released from duty for the long holiday weekend, along with sailors from another ship, the USS Stethem.