South Korea says it is to continue a military intelligence-sharing pact with Japan that had been threatened by a long-running dispute.
The move was welcomed by the US which had urged the two countries to settle their differences.
Seoul announced its decision on Friday, just hours before the pact was due to expire.
Tensions between South Korea and Japan go back decades but have recently led to a series of tit-for-tat measures.
At the centre of the row are the “comfort women” – tens of thousands of Korean women who were forced to work in brothels for Japanese soldiers during World War Two. South Koreans want reparations but Japan considers the issue settled.
Earlier this month the leaders of the two countries briefly met at a summit in Bangkok, Thailand, to try to resolve the row.
In August, South Korea announced it would terminate the intelligence-sharing agreement after Japan removed South Korea’s favoured trade partner status and imposed export controls on its electronics sector.
But on Friday it said it would “conditionally” suspend the expiry.
National security official Kim You-geun confirmed that the pact, known as GSOMIA (General Security of Military Information Agreement), would not be allowed to lapse at midnight.
He said the Japanese government had “expressed their understanding” but warned that the agreement could still “be terminated at any time”.
Japanese Prime Minister Shinzo Abe said bilateral relations were vital and that South Korea had made a “strategic decision” in sticking with the accord.
A US State Department spokeswoman welcomed the decision, saying: “This decision sends a positive message that like-minded allies can work through bilateral disputes.”
What’s the background?
The two countries share a complicated history. They have fought on and off since at least the 7th Century, and Japan has repeatedly tried to invade the peninsula since then.
In 1910, it annexed Korea, turning the territory into a colony.
When World War Two began, tens of thousands of women – some say as many as 200,000 – from across Asia were sent to military brothels to service Japanese soldiers.
Many of these victims, known as “comfort women”, were Korean. Millions of Korean men were also forcibly enlisted as wartime labourers.
Japan’s rule of Korea ended in 1945 when it was defeated in the war.
In 1965, 20 years after Japan’s defeat, South Korean President Park Chung-hee agreed to normalise relations with the country in exchange for hundreds of millions of dollars in loans and grants.
The issue of “comfort women” remains a sensitive one. Tokyo argues that the 1965 treaty that restored diplomatic ties and provided more than $800m in Japanese financial help, has settled the matter.
However, it remains far from resolved.