The decision by Seoul was a surprise to many. In recent days, there had been signs that the two sides were seeking ways to ease the strains.

During a major speech last week, President Moon Jae-in of South Korea sent conciliatory signals to Japanese leaders, saying that “we will gladly join hands” if Tokyo chooses dialogue.

The Trump administration urged Mr. Moon’s government not to abandon the agreement. Stephen E. Biegun, an American envoy, and Allison Hooker, director of Korea policy on the White House National Security Council, met with South Korean officials on Wednesday in Seoul to discuss North Korea and urged them to preserve the deal. The Moon administration did not tell the American officials that it was on the verge of scrapping it.

American officials are closely watching Mr. Moon’s latest move in the context of domestic politics and attempts to shore up support for him and his party, a senior administration official said. It will be difficult to encourage reinstatement of the intelligence-sharing agreement with the current administrations in Seoul and Tokyo, the official added.

The collapse of the deal comes at a particularly sensitive moment in the region. North Korea has conducted six ballistic missile tests in about a month, and Japan and South Korea regularly share analysis about such tests with each other as well as with the United States.

“Our hope was that it would cut down the time that the United States had to play the middle man on intelligence sharing in a crisis,” said Kelly Magsamen, who encouraged the agreement when she was the principal deputy assistant secretary of defense for Asia in the Obama administration. “It’s absolutely essential. In a military crisis, such as a potentially hostile ballistic missile launch, we aren’t going to have time to play referee between Tokyo and Seoul.”