Image copyright EPA Image caption A Japanese flag is rare sight in Beijing

Trade tensions with Washington have driven Japan and China into an unlikely friendship.

Tokyo and Beijing have long been at odds over past military confrontations and present territorial disputes.

Yet on a crucial visit to Beijing, Japan's Prime Minister Shinzo Abe has now hailed a historic turning point.

The two sides are seeking to boost economic ties and regional stability including North Korea.

On Friday Mr Abe met his Chinese counterpart Li Keqiang, and he is due to meet President Xi Jinping later.

How do China and Japan get along?

Usually, not that great. The countries do trade with each other but politically, things have been quite fragile at times.

Japan's World War Two occupation of parts of China remains a very emotional issue and there are several disputed islands that Tokyo and Beijing have yet to agree on.

Mr Abe's current trip to China is the first visit by a Japanese head of government in seven years.

Image copyright Reuters Image caption Mr Abe was welcomed by a Chinese honour guard

"From competition to co-existence, Japan and China bilateral relations have entered a new phase," the Japanese premier told reporters in Beijing.

His Chinese counterpart echoed that sentiment saying they should "return to a normal track" of "stable, sustained and healthy" relations.

Why are the talks important?

It comes at a time of escalating trade tensions between the US and most of the rest of the world.

That means Washington is making it harder for other countries to export to the US market.

The Trump administration has imposed huge trade tariffs which it says are in retaliation for other countries' unfair trade practices.

While Washington's trade war is most prominently fought with China, it also targets many other countries, including Japan.

Biggest economies

Travelling with Mr Abe is a Japanese business delegation hoping to forge closer ties and boost trade.

"Vigorous trade will bring the bonds between our people ever closer," Mr Abe told reporters.

Image copyright Getty Images Image caption Ties between the two sides have been tense in the past

Japan and China are by far Asia's largest economies and the two sides have signed a deal to maintain annual dialogue and to cooperate on innovation.

The also agreed to make it easier for their financial markets to work together and vowed to uphold free trade principles.

There are also plans for a wider regional economic partnership and a special trade zone linking up China, Japan and South Korea.

What about North Korea?

It's not all about trade though. Both sides also say they want to work to safeguard peace and stability in the region.

The biggest threat to peace is widely seen as coming from North Korea, and Tokyo and Beijing have long disagreed on how to deal with the situation.

China is Pyongyang's only remaining economic ally, while Japan has in the past warned against any rush to appease Pyongyang.

North Korean missiles have Japan in easy reach and a number of abducted Japanese citizens remain captives in the North.

At the Beijing summit though, Mr Abe said Tokyo was "determined" to normalise diplomatic relations with Pyongyang if there was progress on denuclearisation and the release of Japanese citizens.