Nearly 70 years after World War II, old animosities are still making it difficult for South Korea and Japan to establish a reliably productive relationship. The result is self-defeating for both countries and for regional security.

Last week, at the last minute, South Korea postponed signing a limited military agreement with Japan. The deal would have encouraged the direct sharing and protecting of sensitive military data about North Korea and China and missile defenses. Such intelligence is now shared indirectly through Washington. The agreement was supported by the Obama administration, which has been working to strengthen a trilateral alliance with the two countries, America’s most important Asian allies.

Although Japan’s cabinet approved the deal, a political firestorm erupted in South Korea, and now its fate is uncertain. That is a huge embarrassment, for Seoul and Tokyo, creating more bad feelings between the two. President Lee Myung-bak of South Korea clearly mishandled the politics. The deal was negotiated in secret, with officials informing the public and Parliament just one day before it was to be signed. This is an election year in South Korea; Mr. Lee’s five-year term ends early next year after a successor is chosen in December. He should have anticipated that his political opponents would lash out as they have, accusing the government of being pro-Japanese. Instead of presenting the agreement as completed, he should have made the case for it publicly and worked to build support for it in advance.

Even then, it would have been a tough sell because animosity toward Japan remains very much alive in South Korea. Japan ruled that country as a colony, often brutally, for several decades until the end of World War II. Although the two nations have growing economic and cultural ties, they still have bitter disputes over a set of islets and Tokyo’s rejection of talks on compensating Korean women used by Japan as military sex slaves during the war.