Barack Obama has met President Xi Jinping, with the former US president hoping to improve ties between their two countries, China’s state media said, as relations between Beijing and Washington are tested over North Korea.

Obama met Xi on Wednesday in Beijing at Diaoyutai Guest House, a sprawling complex frequently used to house visiting leaders. He was in China as part of a world speaking tour.

This file photo taken on November 6, 2017 shows photographs of Chinese President Xi Jinping (C), US President Donald Trump (L) and former US president Barack Obama (R) on display in a photo shop in Beijing. Photo: Fred DuFour/AFP.

Obama told Xi he was willing to continue to play a positive role in enhancing mutual understanding and cooperative exchange between the US and China, according to state broadcaster China Central Television, which featured the meeting in its prime-time news show.

Obama said it was in the interest of both countries to develop a constructive relationship, according to CCTV.

Xi said that China and the US share a common interest and responsiblity in safeguarding world peace and stability.

The meeting came not long after North Korea conducted its latest ballistic missile test.

In response the United States warned North Korea’s leadership that it will be “utterly destroyed” if war breaks out, but its call for nations to cut ties with Pyongyang was rejected by Moscow while Beijing sidestepped talk of an oil embargo.

Chinese state media did not say if the topic was discussed by Xi and Obama.

The state broadcaster said Xi told Obama about the achievements of China’s recently concluded 19th Communist Party Congress when he was installed for another five year term.

Obama began his trip to China on Tuesday with a speech to the Global Alliance of SMEs Summit in Shanghai, a non-government organisation promoting small business interests.

He also met Liu Cixin, a prolific Chinese science fiction writer and author of the award-winning “The Three Body Problem” series.

Obama was set to leave China on Thursday for India where he is scheduled to meet Prime Minister Narendra Modi.

AFP is a global news agency delivering fast, in-depth coverage of the events shaping our world from wars and conflicts to politics, sports, entertainment and the latest breakthroughs in health, science and technology.