HANGZHOU, China (Reuters) - China and Japan agreed on Monday to improve relations but still lectured each other over maritime rows that remains a recurrent flashpoint.

Chinese President Xi Jinping welcomes Japanese Prime Minister Shinzo Abe to the G20 Summit in Hangzhou, Zhejiang province, China September 4, 2016. REUTERS/Damir Sagolj

Ties between the two countries, which have Asia’s largest economies, have long been overshadowed by arguments over their painful wartime history and a territorial dispute in the East China Sea.

“We must make efforts with China to improve relations from a big-picture perspective,” Japanese Prime Minister Shinzo Abe said after meeting Chinese President Xi Jinping, who was hosting a summit of the Group of 20 big economies in Hangzhou, China.

Xi told Abe that the two neighbours should “put aside disruptions” and bring their relations back on the normal track as soon as possible, as ties are still “troubled by complications at times”, according to China’s state-run Xinhua news agency.

“Both sides should bolster their sense of responsibility and crisis awareness, and work to build on the positive elements of bilateral ties while putting a lid on negative ones, in order to ensure stable improvement of relations,” Xi said.

The two agreed to accelerate talks on a communications mechanism between their militaries, Abe told a news conference.

But both leaders stuck to their positions over the dispute over tiny isles in the East China Sea, controlled by Japan, which calls them the Senkaku, but claimed by Beijing as the Diaoyu.

Abe called recent incursions by Chinese vessels near the isles “regrettable,” said Japanese Deputy Chief Cabinet Secretary Koichi Hagiuda.

“There are various problems between us because we are neighbours,” Abe said. “That makes it all the more important to have dialogue. I will seek stability in the East China Sea situation through dialogue and consultation and work with China to make it a sea of peace, cooperation and friendship in the true sense.”

Xi said China and Japan should properly handle the East China Sea issue via dialogue and consultation to “jointly safeguard peace and stability in the region”, according to Xinhua.

The Chinese host also told Abe to exercise caution on the issue of the South China Sea, where China has refused to recognise a July ruling by an arbitration court in The Hague invalidating China’s vast claims to the waters.

Beijing has accused Tokyo of interfering in the South China Sea, where China and several Southeast Asian nations are embroiled in an argument over ownership.

Xi said Japan should “exercise caution in its words and deeds” on the South China Sea issue, Xinhua said.