TOKYO/SEOUL -- South Korea on Friday told Japan that it would reverse its decision to end the two U.S. allies' intelligence-sharing agreement -- hours before its expiration.

Seoul said a condition of the agreement was Japan's removal of restrictions on shipments to South Korea. Japan's Ministry of Economy, Trade and Industry said on Friday that it will restart talks with South Korea on the export controls issue.

"The military intelligence-sharing pact between South Korea and Japan remains solid," South Korean President Moon Jae-in told opposition party leader Hwang Kyo-ahn through his secretary on Friday.

Japanese Prime Minister Shinzo Abe said he believes Seoul's last-minute decision was "strategic" in light of the North Korean threat. "It's extremely important for Japan, South Korea and the U.S. to cooperate and coordinate actions to cope with North Korea," he said.

The extension of the agreement, known as the General Security of Military Information Agreement, or GSOMIA, appears likely to symbolically and practically improve the stability of the East Asian security environment. This is because it has direct consequences for intelligence-sharing on matters related to North Korea.

"We announced this decision as the authority in charge of export controls. It has nothing to do with GSOMIA," Yoichi Iida, director general of METI's trade control department, said at a news conference in Tokyo.

Kim You-geun, secretary-general of South Korea's National Security Council, said Seoul had decided to stop the process of filing a complaint with the World Trade Organization over Japan's export controls "as long as talks between South Korea and Japan go well."

The pact was signed Nov. 23, 2016, by the Japanese government and the administration of then-South Korean President Park Geun-hye to keep sensitive shared military information out of the hands of third countries. The agreement had been automatically renewed on an annual basis. But Moon's administration said Aug. 23 that it would terminate the deal, the month after Japan imposed restrictions on exports of key semiconductor-manufacturing materials to the South.

Any strain in security cooperation among Washington, Tokyo and Seoul could have opened up cracks for not only Pyongyang, but also Beijing and Moscow, to expand military activity in East Asia. When South Korea previously said it would cancel the deal, Japanese Chief Cabinet Secretary Yoshihide Suga responded that Seoul had "completely misread" the regional security environment. Both Japan and the U.S. have repeatedly pressed to keep the pact alive.

The chill between Tokyo and Seoul stems from 2018 rulings in which South Korea's highest court ordered Japanese businesses to pay compensation to South Koreans forced to work for them during World War II. Tokyo views such claims as completely and finally resolved under a treaty signed in 1965 when they normalized diplomatic relations and has urged Seoul to correct the move. The South has refused, citing judicial independence.

The thaw between Japan and South Korea appears unlikely to continue unless issues surrounding the wartime labor ruling can be resolved. There have been pushes from within both governments to have Abe meet directly with Moon when the two are in China for a three-way summit in December.