A state visit by Chinese President Xi Jinping has been postponed as preventing the outbreak of the new coronavirus is "the biggest challenge" facing both countries, Japan's top government spokesman said Thursday.

"It is necessary to give first priority to this," Chief Cabinet Secretary Yoshihide Suga told reporters in Tokyo.

Prime Minister Shinzo Abe formally invited Xi to visit during last year's G20 summit in Osaka.

The last state visit by a Chinese president to Japan was in 2008, and Xi's trip was being cast as a sign of warming bilateral ties.

The coronavirus outbreak, however, has delayed the visit.

"China and Japan are both currently fully fighting the NCP (novel coronavirus pneumonia) epidemic," Zhao Lijian, foreign ministry spokesman, told a news conference in Beijing.

"Both sides agreed on the necessity of ensuring that Chairman Xi Jinping's state visit to Japan takes place at the most appropriate timing, environment and atmosphere, and achieves full success."

Japanese officials had in recent weeks insisted that the trip was on despite the spread of the virus.

"A visit to Japan by a Chinese president is once-in-a-decade event," Foreign Minister Toshimitsu Motegi said last week.

"It is important that we will make sure that it will be something that will result in full achievements," he added, in comments seen at the time as suggesting the trip could be delayed.

The virus has infected more than 95,000 people worldwide and killed over 3,200.

The postponement came as Japan steps up its response to the epidemic, which has infected at least 317 people and been linked to six deaths domestically.

Japan's Prime Minister Shinzo Abe (left) shakes hand with China's President Xi Jinping at the Great Hall of the People in Beijing
Japan's Prime Minister Shinzo Abe (left) shakes hand with China's President Xi Jinping at the Great Hall of the People in Beijing POOL / Noel CELIS

Tokyo has faced criticism for acting slowly when the outbreak began and for its handling of the Diamond Princess cruise ship, where more than 700 people contracted the virus.

On Thursday, the Yomiuri daily reported that Japan will quarantine all arrivals from China and South Korea for two weeks, without specifying when the measures were expected to take effect.

In an exclusive, the paper said Chinese and Korean tourists would be asked not to visit Japan, and visas would be suspended.

The Yomiuri said the measures would be announced by Abe later Thursday.

Relations between Asia's two biggest economies have warmed in recent years after suffering in 2012 when Tokyo "nationalised" disputed islands claimed by Beijing.

Abe visited Beijing in 2018 -- the first official visit by a Japanese prime minister since 2011.

He also visited China last December to hold talks with South Korea's Moon Jae-in and Chinese Premier Li Keqiang for a trilateral summit. During his stay in China, Abe separately met Xi.

Last June, Abe met Xi on the sidelines of the G20 and invited him for a state visit.

"I want to enhance Japan-China relations... by welcoming President Xi Jinping to Japan during cherry blossom next year," Abe said at the time.

The world's second- and third-largest economies have a fraught relationship, complicated by longstanding maritime disputes and Japan's wartime legacy.

The thaw has accelerated in recent months as both countries face trade battles with US President Donald Trump.