Japan and China pledged Friday to accelerate new economic cooperation by changing the dynamics of bilateral relations "from competition to collaboration," as ties markedly improve amid trade disputes with the United States.

Chinese President Xi Jinping also told Japanese Prime Minister Shinzo Abe during their talks in Beijing that he will "seriously" consider making a trip to Japan next year, with both expressing willingness to promote high-level reciprocal visits.

Tokyo and Beijing made an agreement to create a "new framework" to jointly move ahead with infrastructure projects in third nations and strengthen a wide range of cooperation ranging from finance to innovation, Abe said at a press conference.

Japan has already announced it will discontinue its 40-year official development assistance to China. By bolstering investment in other countries, the governments of Asia's two biggest economies will aim to form a new model of economic cooperation between them.

Early Friday, Abe agreed with Chinese Premier Li Keqiang to start talks about cooperation in state-of-the-art technology and protection of intellectual property rights, as well as to resume their currency swap line in times of financial emergency.

"Japan and China are neighbors and partners. We will not become a threat of each other," Abe told Li at the outset of their meeting.

Abe arrived in Beijing on Thursday for the first official visit to China by a Japanese political leader in nearly seven years. Until late last year, relations between Tokyo and Beijing had been at their worst level in decades over a territorial row in the East China Sea.

Since earlier this year, Japan and China have been trying to boost economic ties as U.S. President Donald Trump has either threatened or implemented tariffs in an attempt to curb the huge U.S. trade deficits with them.

Li told Abe, "We would like to achieve win-win outcomes by stably developing our ties in the long term. Especially regarding our economic and trade cooperation, we earnestly want to lift it to a new phase."

At his talks with Xi later Friday, Abe invited Xi to visit Japan sometime in 2019 and on the occasion of the 2020 Tokyo Summer Olympic Games, a Japanese government official told reporters.

Xi told Abe that China and Japan should move bilateral relations in a "new historic direction" as "instability and uncertainties are growing" worldwide, adding the two countries "have been sharing wider and more pluralist common interests and common concerns."

"Sound and stable development of China-Japan relations would become fundamental benefits of people of the two nations, which is widely hoped by this region and the international community," Xi said.

Abe and the Chinese leaders agreed that Japan and China will remain committed to free trade, apparently pushing back against Trump's trade protectionism.

Aiming to deepen trust in the security field, Tokyo and Beijing also signed an agreement to facilitate cooperation over search and rescue operations in the event of accidents in waters off the two nations.

Abe said Japan and China agreed to work together to open a hotline as soon as possible to avert accidental clashes at sea and in the air, adding that they should make efforts to make the East China Sea a "sea of peace, cooperation and friendship."

The Japanese prime minister asked Xi to improve the unstable situation in the contested waters, the official said. Abe and Xi agreed to continue to communicate to restart talks about a 2008 bilateral accord on joint gas development there.

Both countries, meanwhile, confirmed the importance of cooperation between them to achieve denuclearization of North Korea, with Abe saying Tokyo and Beijing will "fulfill responsibilities" for peace and stability in East Asia.

Abe also said China has promised to consider, on scientific grounds, relaxing its ban on Japanese food imports that was imposed following the 2011 Fukushima nuclear crisis triggered by a devastating earthquake and tsunami.

As a symbol of friendship, the two sides agreed to push forward talks about another giant panda to be leased to a zoo in Japan, the Japanese official said.

During their meeting on Friday, however, Abe and Li were at odds over several matters such as human rights and economic practices.

With reports of the mass detentions in China's far-western region of Xinjiang in mind, Abe told Li, "The international community including Japan has been paying close attention to the human rights situation in China," according to the official.

Tensions remain high in Xinjiang between Chinese authorities and the native Uighurs, a Turkic-speaking and largely Muslim ethnic group. Many Uighurs, who complain of religious and cultural oppression by China's Han-dominated government, have been detained under the "reeducation" campaign.

Abe also urged China to take measures to prevent intellectual property theft.

For years, Tokyo and Beijing had been mired in a territorial dispute over the Senkaku Islands in the East China Sea. The group of uninhabited islets, which are called Diaoyu in China, are controlled by Japan but claimed by Beijing.

Strains particularly intensified after the Japanese government of former Prime Minister Yoshihiko Noda, Abe's predecessor, decided to bring the Senkakus under state control in September 2012.

But the situation has changed recently, as this year marks the 40th anniversary of the signing and entering into force of the Treaty of Peace and Friendship between Japan and China.