A key moment of Japanese Prime Minister Sanae Takaichi's official visit to the US was President Donald Trump's comment on a piece of shared history - Pearl Harbor.

Asked by a Japanese journalist why the US had not warned its allies it was going to strike Iran on 28 February, Trump referenced the 1941 Japanese attack on US soil.

Who knows better about surprise than Japan? Why didn't you tell me about Pearl Harbor? Trump said as the prime minister appeared to be opening her eyes wide and taking a deep breath.

The Pearl Harbor attack led to the US joining World War Two, and the US later dropped two atomic bombs on Japan. The countries became close allies in later years after the war ended.

Trump's remark appeared to draw some laughter from journalists and others present in the room at the White House, while Takaichi's reaction seemed to reflect some of the unease that surrounds the issue. Mineko Tokito, a senior reporter from Japanese newspaper Yomiuri Shimbun, noted Takaichi's discomfort was clear.

Prime Minister Takaichi viscerally reacted, her eyes widening and her smile disappearing as she leaned back, drawing her hands in, clearly taken aback by the sudden mention of Pearl Harbor, she said.

The unfavorable context of the historical reference stirred unease among the Japanese public. Yuta Nakamura, a 33-year-old engineer, praised Takaichi for navigating the situation tactfully, emphasizing that it put her in a difficult position.

Despite the discomfort, the meeting proceeded with Takaichi discussing Japan's willingness to support US efforts regarding tensions in the Strait of Hormuz, amid heightened geopolitical strife.