Japan and China have largely agreed on how to implement a maritime and aerial communication mechanism aimed at averting unintended clashes in and above the East China Sea, despite a long-running territorial row over a group of small islands in the area, sources close to bilateral ties said Wednesday.

The mechanism, a sort of hotline between defense officials of the two countries, is expected to be put into practice in the near future after a decade of negotiations.

The deal was struck during a two-day meeting of senior officials in Shanghai, said the sources, who spoke on condition of anonymity. It is yet another sign of bilateral ties improving at a faster pace after Chinese President Xi Jinping consolidated more power through his ruling party's twice-a-decade congress in October.

The major progress has also been made after Japanese Prime Minister Shinzo Abe and Xi agreed last month on the sidelines of a regional economic summit in Vietnam that Asia's two biggest economies would make a "new start" in their relationship.

After the Shanghai meeting, the Japanese and Chinese foreign ministries said in separate statements that the two countries have made "positive progress" for the start of the mechanism and agreed to enhance mutual trust by promoting closer exchanges between their defense authorities.

The statements did not elaborate on what kind of progress was made. But one Japanese government official said, "Obstacles are disappearing."

Diplomats and defense officials from the two countries were engaged in behind-the-scenes negotiations this autumn and both sides agreed during the two-day meeting that they will leave the geographical scope of the crisis management hotline undefined, according to the sources.

For a long time, one of the major stumbling blocks in their efforts to establish the mechanism was how to treat territorial waters and airspace around the Japan-controlled Senkaku Islands, which that China claims and calls the Diaoyus.

Taiwan also claims the uninhabited islands, which it calls the Tiaoyutais.

Japan has insisted that its territorial waters and airspace do not fall within the scope, out of concern that China could take advantage of the mechanism to strengthen its claim to the islands by interpreting the new framework as giving it the legitimate right to approach them.

In working toward the implementation of the Maritime and Aerial Communication Mechanism, senior Japanese and Chinese officials are believed to have agreed that the system will not undermine the legal positions of each country.

Japan and China still need to work out the details of the mechanism before reaching an official agreement.

A plan to create a maritime and aerial hotline was first agreed between the two countries in 2007.

But for years the negotiations did not go smoothly as disagreements over the islands and wartime legacy issues, as well as regional rivalry, often stymied relations between the world's second- and third-largest economies.

After the Japanese government purchased some of the islands from a private Japanese owner in 2012 to bring them under state control, China continues to regularly send its ships around the Senkakus.

Chinese and Japanese ships and aircraft have been playing a dangerous game of cat and mouse around the islands, causing simmering worries in the region that accidents or miscalculations could precipitate a wider conflict.

During the Shanghai meeting, attended by a total of 80 officials from multiple government bodies, the two countries discussed a range of other maritime issues, including joint gas development, environment protection, anti-smuggling, and search and rescue.

The senior officials agreed to hold the next round of their discussions in the first half of next year in Japan, according to the two ministries.