WASHINGTON — The Trump administration, scrambling to avoid a rift with an ally, has told South Korea it is open to holding preliminary talks with North Korea, according to two senior administration officials and a spokesman for the South Korean president, Moon Jae-in.

The decision, which came after Vice President Mike Pence attended the Winter Olympics in Pyeongchang, South Korea, and met with Mr. Moon, reflects how thoroughly the diplomatic channel between the North and South has upended the administration’s calculations.

For months, the White House has rejected the idea of meeting with North Korea unless it took measurable steps toward giving up its nuclear stockpile and curbing its provocative behavior. Now, though, with Mr. Moon determined to engage with the North, these officials said the administration has decided on a course correction.

The decision was a victory for South Korea. “The United States, too, looks positively at South-North Korean dialogue and has expressed its willingness to start dialogue with the North,” Mr. Moon said on Tuesday, according to his spokesman, Kim Eui-kyeom.