Japan and China have agreed to strengthen confidence-building measures in a security dialogue held for the first time in nearly two years.

During the meeting in Beijing on Monday involving senior diplomats and defense officials, both sides explained each other’s security policies and “frankly” discussed major challenges facing the region and the rest of the world, the Japanese government said.

The government also said Japan asked China to make its security polices more transparent.

The talks in Beijing took place as the two countries attempt to set up a maritime and aerial communication mechanism to prevent accidental clashes in and above the East China Sea, where China has been asserting its claim to the Japan-administered Senkaku Islands.

Prime Minister Shinzo Abe and Chinese President Xi Jinping have agreed to ease tensions stemming from a standoff over sovereignty of a group of tiny islands in the sea.

But the two countries have made little headway in establishing the communication mechanism, a sort of hotline between their officials.

China has been asserting its claim to the Japan-controlled Senkaku Islands and continuously sending ships around them.

One of the major stumbling blocks in their efforts to implement the mechanism lies in how to treat territorial waters and airspace around the uninhabited islets, which China calls Diaoyu.

Japan has demanded that they not fall within the scope of the mechanism, while China has argued the opposite.

The meeting, which lasted 4½ hours, was held before Chinese Premier Li Keqiang’s potential first visit to Japan since taking office in 2013. He may visit next month to attend a trilateral summit involving the two countries and South Korea.

Kong Xuanyou, China’s assistant foreign minister, said he hoped the dialogue will play an “active role in enhancing the momentum of improving ties between the two countries.”

“As it is true that there exist concerns over each other’s security policies, it is indispensable to have this kind of direct dialogue for confidence building,” Japanese Deputy Foreign Minister Takeo Akiba replied at the outset of the meeting at the Diaoyutai State Guesthouse.

The last time Japan and China held this kind of dialogue was in March 2015.