CHENGDU, China/SEOUL- Japanese Prime Minister Shinto Abe asked South Korea's president on Tuesday to take steps to resolve a bitter dispute at their first bilateral talks in 15 months, a sign that while the mood is improving, knotty problems between the U.S. allies remain.

Abe and South Korean President Moon Jae-in stressed, at their meeting in China, the need to improve ties after the worst period of tension between their countries in decades.

Relations have been strained since South Korea's Supreme Court last year ordered Japanese firms to compensate some South Koreans forced to work for them during Japan's 1910-45 colonial rule. Japan says the issue was settled under a 1965 treaty and that the court ruling violated international law. 

"South Korea should take responsibility and come up with measures to resolve the issue," Abe told a news conference. "I asked that South Korea initiate steps to restore ties between Japan and South Korea to a healthy state."

Moon and Abe met on the sidelines of a trilateral summit with Chinese Premier Li Keqiang in the Chinese city of Chengdu, with tension over stalled denuclearisation talks between North Korea and the United States the main issue. 

After the Korean court ruling, Japan imposed restrictions on the export to South Korea of high-tech materials used in the manufacture of chips, compounding their dispute which threatened to undermine security cooperation between them.

Abe and Moon agreed to meet more often despite differences over history and trade, Moon's spokeswoman, Ko Min-jung, told a briefing in Chengdu, adding they both wanted to resolve differences through dialogue.

Abe said close security cooperation with the United States was "extremely important" in dealing with North Korea.

The two leaders had "candid" discussions recognising the importance of dialogue, though there were still "substantive differences," said Japan's Deputy Chief Cabinet Secretary Naoki Okada. He said the mood was tense at times but not confrontational.

Moon expressed hopes for an early solution to their differences.

"Japan and South Korea are historically and culturally the closest neighbours," Moon said. "We're not in a relationship that can set the two apart even when there's some discomfort for a while."

The two shook hands and smiled slightly before their 45-minute meeting, longer than the planned 30 minutes.

South Korea last month made a last-minute decision to maintain an intelligence-sharing deal with Japan that is important for trilateral security cooperation with the United States. 

(Reporting by Norihiko Shirouzu in Chengdu and Hyonhee Shin in Seoul Additional reporting by Kiyoshi Takenaka in Tokyo Editing by Robert Birsel and William Mallard) ((hyonhee.shin@thomsonreuters.com; 822 6936 1474;))