The Trump administration has abruptly decided that Washington’s pick for ambassador to Australia should instead become envoy to South Korea, filling a diplomatic void just as President Trump prepares to meet Kim Jong-un, North Korea’s leader, officials said on Wednesday.

The shift involving Adm. Harry B. Harris Jr., commander of the United States forces in the Pacific, is a diplomatic blow to Australia, a close American ally. Australia’s foreign minister, Julie Bishop, confirmed that Admiral Harris would not be taking the post in Australia.

“While we would have welcomed Admiral Harris here as ambassador to Australia, we understand that there are significant challenges for the United States on the Korean Peninsula,” Ms. Bishop said.

The Trump administration’s decision to nominate Admiral Harris for the posting in Seoul was confirmed by a recent member of the staff of the Pacific Command who discussed the matter on condition of anonymity.