China and South Korea's foreign ministers have held their first talks in Beijing in more than six years, as both countries look to boost sagging ties and pave the way for a trilateral summit with Japan in Seoul slated for later this month.

China’s top diplomat, Wang Yi, and South Korean Foreign Minister Cho Tae-yul met in the Chinese capital for four hours on Monday, discussing the summit and bilateral relations as the two neighbors aimed to stabilize ties that have faltered in recent years amid the growing rivalry between China and the United States — Seoul’s ally.

"The two ministers agreed to continue cooperation for the successful opening of the ninth South Korea-Japan-China summit that is due to soon take place in South Korea," the South Korean Foreign Ministry said in a statement.

South Korea has not formally announced the date for the trilateral summit, but media reports have said it will take place on May 26 and 27.

Cho’s two-day trip to Beijing comes as the administration of South Korean President Yoon Suk-yeol forges even stronger relations with the United States and thaws a once-frosty relationship with Japan, taking trilateral security ties to fresh highs.

Ostensibly aimed at deterring nuclear-armed North Korea, the U.S.-South Korea-Japan trilateral security cooperation, in particular, has unnerved China, which some observers argue is the actual target of the bolstered relationships.

Under Yoon, Seoul has moved closer to Washington, and the South Korean president last year referred to the fate of self-ruled Taiwan as a “global issue.” The move deeply angered China, which regards Taiwan as a “core issue” and calls the democratic island a renegade province that must be unified with the mainland, by force if necessary.

Wang said that ties between Beijing and Seoul have "faced difficulties and challenges, which are not in the common interest of both parties and not what China wants to see," according to the Chinese Foreign Ministry.

“China hopes the ROK side abides by the ‘One China’ principle, properly and prudently handles Taiwan-related issues, and consolidates the political foundation of bilateral relations,” Wang told Cho, according to the ministry. ROK is the abbreviation for South Korea's official name, the Republic of Korea.

Wang also urged Seoul to “eliminate external interference” — in what appeared to be a veiled warning against South Korea continuing to follow the U.S. on sensitive issues such as semiconductors, supply chains and other areas. Washington has implemented various measures aimed at isolating Beijing in a number of strategic sectors such as chipmaking and supply chains, and is reportedly due to unveil fresh tariffs on electric vehicles soon.

Still, the two ministers appeared anxious to put a floor under their countries’ plummeting ties, with both sides reaffirming the “value” of the bilateral relationship and the need to develop it into a "healthy and more mature" one, the South Korean Foreign Ministry said.

China is South Korea’s largest trading partner and has traditionally carried sway in nuclear diplomacy with North Korea, and Seoul hopes to use the two days of talks to help right the relationship.

During their talks, Cho reportedly stressed that aligning with one country — the U.S. — doesn’t mean that South Korea is drifting away from the other — China.

"We don't perceive foreign relations as a zero-sum relationship, nor do we manage them as such," the Yonhap news agency quoted Cho as saying.

"I believe it's important that not one side, but both sides, make efforts to carefully manage ties in a way that disagreements will not turn into conflicts for the development of bilateral relations," he added.

Chinese state-run media has also lauded Seoul's effort to hold the first trilateral leaders' summit with Japan since 2019, saying that the meeting "offers the opportunity for the three countries to find ways to work together for their mutual benefit."

"Yet the challenges faced by the trilateral relations over the past five years should remind Seoul, as well as Tokyo, that it is imperative to carry out exchanges in good faith if the three neighbors are to delve into the issues where their ties really rub," the China Daily newspaper said in an editorial this week.

On North Korea, Cho raised concerns with Wang over Pyongyang's "illegal military cooperation” with Russia amid Moscow’s war in Ukraine, urging Beijing — a permanent member of the United Nations Security Council — to play a constructive role in working toward peace and security on the Korean Peninsula and for the North's denuclearization.

Analysts say Russia has received shipments of North Korean ballistic missiles in violation of U.N. sanctions that it has used in the Ukraine conflict. That move has been a quid pro quo, with Moscow effectively nixing a U.N. expert panel monitoring sanctions on Pyongyang with a veto at the Security Council in late March.

China, long seen as North Korea's most important ally and economic lifeline, abstained from that vote, and Cho urged Beijing to do more to rein in Pyongyang amid its unprecedented spate of weapons tests and increasingly fiery rhetoric.

Cho also highlighted the importance of more high-level engagements, inviting Wang to visit Seoul soon, the South Korean Foreign Ministry said, with the top Chinese diplomat saying that he would do so at a "mutually convenient time.”

Cho’s visit was the first to Beijing by a South Korean foreign minister since November 2017, though the two countries’ top diplomats held bilateral talks in 2022.