South Korean President Moon Jae-in on Tuesday said he still has slim hopes that a military intelligence-sharing pact with Japan can be saved before it expires Saturday, saying Seoul will exert efforts to prevent that from happening.

Appearing on television for a question-and-answer session, Moon said South Korea will seek to settle the issue of the General Security of Military Information Agreement until the very last minute.

But even if the issue cannot be settled, he said, South Korea and Japan would still be able to cooperate on security matters.

Tokyo and Washington have both urged Seoul to reconsider its decision to end the three-year-old pact, as they are concerned about a possible weakening of the trilateral security cooperation.

The accord is mainly aimed at countering the North Korean nuclear and missile threat and facilitating three-way defense cooperation with the United States.

It had been automatically renewed annually since it was signed on Nov. 23, 2016, and was due to be extended until Seoul decided to abandon it.

Seoul insists it will only reconsider its August decision to scrap the agreement if Tokyo first reverses its move earlier this year to tighten controls on exports of some materials needed by South Korean manufacturers of semiconductors and display panels.