Donald Trump addressed military personnel aboard the USS Wasp after a quick stop on a Japanese warship nearby.
“Happy Memorial Day,” the president told more than 800 service members aboard the amphibious assault ship, calling them “daring and mighty warriors in the Pacific”.
It was the second ship Mr Trump visited after he landed on the Japanese destroyer JS Kaga.
Emperor Naruhito and Empress Masako also are expected to visit with the Trumps before they head home to the US later in the day.
The US honoured its war dead on Memorial Day on Monday.
Mr Trump has been criticised for skipping visits to cemeteries to honour US troops, but he placed flags on graves in Arlington Cemetery last week before leaving for Japan.