IT IS a feature of the fraught relationship between Japan and South Korea that the two are at once able to bicker and to work together. Last week South Korea summoned Japanese diplomats to protest over revisions to school textbooks, which it said were a fresh attempt by Japan to gloss over the evils of its wartime past. South Korea’s prime minister, Lee Wan-koo, said Japan would face “grim judgment” if it failed to admit the “realities of history”.

Yet on April 14th the two countries met in Seoul, the South Korean capital, for their first high-level security talks since 2009—a further sign of a thaw in relations after a three-way summit last month between the foreign ministers of China, Japan and South Korea. At the bilateral talks, foreign-affairs and defence officials chiefly discussed Japan’s military policy—in particular, the first revamp in two decades of joint-defence guidelines between America and Japan. It would allow Japanese forces to support American troops in the event of a crisis on the Korean peninsula.

An agreement on the final guidelines is expected in late April, when Shinzo Abe, Japan’s prime minister, will visit Washington. In parallel, Japan’s government is also revising constitutional interpretations to allow its forces to take part in collective self-defence. South Korea has been wary of Mr Abe’s dream of reinterpreting Japan’s pacifist constitution. It has called for reassurances first from the former occupying power on Japan’s views on history.

Revisionist voices have grown louder in Japanese education. Last week the government approved a set of school textbooks that dilute references to wartime atrocities, including the forcing of “comfort women” into brothels by Japan’s imperial army. Many of them were from South Korea. All the textbooks stress that a group of rocks controlled by South Korea (which calls them Dokdo) and claimed by Japan as Takeshima, are Japan’s “inherent territory”—which is nonsense. Equally nonsensical, South Korea claims that Japan’s review of its defence arrangements would allow it to push South Korea about.

That the talks went ahead despite tensions suggests that both sides are eager to improve co-operation in dealing with a shared security worry: North Korea. America’s heightened keenness that its two allies should get along has helped, too. On a visit to the region this month, Ashton Carter, America’s defence secretary, promised to deploy more state-of-the-art weaponry to counter North Korea.

China’s growing willingness to talk to Japan may also have spurred South Korea to overcome its scruples about doing so. Last month China and Japan met for their first high-level security talks in four years. By meeting Japan, however, South Korea could also be signalling to China that it still sees itself as part of America’s network of alliances. It does not want China to meddle in its defence decisions, such as whether to accept an advanced anti-missile defence system from America. China fears the system could be used against it.

Further improvement in relations between Japan and South Korea will depend on what Mr Abe says in a series of statements this year on Japan’s wartime history, culminating in a speech in August on the 70th anniversary of the end of the second world war. The South Korean public is still in no mood to forget.