BEIJING — North Korea’s leader, Kim Jong-un, arrived in Beijing on Tuesday amid an escalating trade conflict between China and the United States, one that gives him an opening to play the powers against each other as Washington presses him to dismantle his nuclear arsenal.

“This could be regarded as an intuitive response to Trump’s escalation of the trade war,” Shi Yinhong, a professor of international relations at Renmin University in Beijing, said of China’s invitation to Mr. Kim.

The surprise trip, just a week after his landmark summit meeting in Singapore with President Trump, is the North Korean leader’s third visit to China since March. His two-day trip was announced by Xinhua, China’s official news agency, as Mr. Kim was arriving on Tuesday morning; his previous stops in China were not made public until after they were over.

For his first one, in March — which was also his first trip abroad, and his first meeting with a head of state, since becoming the North’s leader — Mr. Kim arrived in Beijing aboard an armored train, and he spent two days in the capital for talks with President Xi Jinping. In May, Mr. Kim visited the port city of Dalian, also spending time with Mr. Xi.