BEIJING - South Korea's reassurances to China over its security concerns paved the way for better relations and President Moon Jae In's state visit, analysts said.
And Mr Moon's visit has in turn boosted ties between the neighbours strained by South Korea's deployment of an anti-missile system that Beijing said hurt its security interests.
But what could have motivated the Chinese to mend ties with Seoul could be the strategic importance of a good relationship with the South Koreans, say analysts.
Mr Moon met President Xi Jinping on Thursday (Dec 14), during which the leaders pledged to improve ties and cooperate on resolving the North Korean nuclear issue peacefully.
At his meeting with Premier Li Keqiang on Friday, Mr Li said the two sides may soon reopen communication channels to discuss economic issues, South Korean media reported.
Mr Moon, in an effort to draw the two sides closer together, also highlighted the common history of the two countries by sending his ambassador to Nanjing on Thursday to attend ceremonies to commemorate the 80th anniversary of the massacre wrought by Japanese soldiers during their occupation of the city.
Mr Moon himself will visit on Saturday the site of the Korean provisional government in Chongqing during World War II when Korea was occupied by the Japanese.
South Korea in July last year had agreed with the United States to deploy the Terminal High Altitude Area Defence (Thaad) anti-missile system, at a time of rising tension in the Korean peninsula as North Korea stepped up its nuclear and missile development programmes.
However, the Chinese objected to the deployment as they think the missile defence system undermined its strategic security interests. It took economic retaliatory measures that shaved off 0.3 percentage point from South Korea's growth this year.
But things took a turn for the better in late October with the two sides agreeing to put ties back on track. This has been made possible through Seoul's agreement to conditions known as the "three Nos" - no deployment of additional Thaad batteries, no joining of a US-led missile defence network and no trilateral security alliance with the US and Japan.
This provided some assurance to the Chinese and, besides, they may have realised it was impossible to get the South Koreans to completely drop Thaad, said security analyst Li Mingjiang of the S. Rajaratnam School of International Studies.
"Coercing the South Koreans to do so will further damage China-South Korean ties and ultimately push South Korea much closer to the US," he said. This, he added, will be detrimental to China's security environment in North-east Asia.
On the other hand, better ties with the South Koreans would undermine any US plan to further strengthen its military presence and deterrent capability against China, particularly the American plan to link up its anti-missile systems in the region, he said.
On the nuclear issue, China and South Korea are opposed to war in the region and if they could articulate this together, it would greatly constrain the US, he said.
And if war should occur, "a more positive relationship between Beijing and Seoul will help China deal better with the aftermath", including resettlement of refugees, reunification of the Korean peninsula and the US military presence there, said Associate Professor Li.
However, said Professor Jia Qingguo of Peking University, Thaad as an issue remained and if the North Korean nuclear issue eased up or progress was achieved on it, then the Thaad batteries would have to be removed.