WASHINGTON — The White House on Wednesday barred four American journalists from covering President Trump’s dinner with the North Korean leader, Kim Jong-un, in Hanoi, Vietnam, after two of the reporters called out questions to Mr. Trump at an earlier appearance.

It is highly unusual for a presidential administration to retaliate against reporters by restricting their access, particularly at a closely scrutinized foreign summit meeting. Given the backdrop — a United States president meeting with the totalitarian leader of a country with no independent media — the move sent a starkly different message from those delivered in such settings by Mr. Trump’s predecessors, who often sought to encourage expressions of press freedom when meeting with representatives of autocratic regimes.

Shortly before the dinner was to start, Sarah Huckabee Sanders, the White House press secretary, informed the group of journalists traveling with Mr. Trump that only photographers and television-camera operators would be allowed to attend the event, excluding reporters for several print and radio news outlets.

Ms. Sanders cited the “sensitivities” of the meeting and “shouting” by reporters at a previous appearance by Mr. Trump and Mr. Kim, during which a reporter for The Associated Press, Jonathan Lemire, asked the president to comment on the congressional testimony of Mr. Trump’s former lawyer, Michael D. Cohen.