Chinese President Xi Jinping had considered visiting Singapore until just before the unprecedented U.S.-North Korea summit was held earlier this week in the city-state, diplomatic sources said Friday.

But the plan was dropped after China realized that U.S. President Donald Trump and North Korean leader Kim Jong Un were unlikely to agree at Tuesday's summit to promote talks toward signing a peace treaty to end the Korean War, according to the sources in Beijing and Singapore.

China has welcomed the start of official talks between the United States and North Korea, but at the same time worries about being bypassed while the administrations of Trump and South Korean President Moon Jae In take the lead in denuclearization talks with its neighboring country.

On Thursday, Xi told U.S. Secretary of State Mike Pompeo in Beijing that China will "continue to play an active and constructive role, and work with relevant parties, including the United States," according to the Chinese Foreign Ministry.

In late May, China told Singapore that Xi might visit Singapore at the time of the Trump-Kim summit and requested cooperation on security and selecting the best place for him to stay, according to the sources.

(Kim Jong Un in the backseat of a car in Singapore as he heads home after a summit with Trump)

Around when the request was made, South Korean officials were not ruling out the possibility of Moon joining Trump and Kim in Singapore.

The Chinese leadership finally decided not to go ahead with Xi's trip after hearing final arrangements for the summit from Singapore's Foreign Minister Vivian Balakrishnan, who made a three-day visit to North Korea through June 9, according to the sources.

China has sought to play a pivotal role in negotiations toward replacing the Korean War armistice with a peace treaty.

In addition to whether a peace treaty would be mentioned in any form during the summit, China was also keen to know if the two leaders would discuss a reduction of U.S. forces in South Korea, the sources said.

In a joint statement, signed by Trump and Kim at the summit, North Korea committed to "complete denuclearization" and the United States pledged to provide it with security guarantees, but the document lacks details on how to fulfill those promises.

Relations between China and North Korea have improved since Kim visited Beijing in March for talks with Xi, which marked his first foreign trip since inheriting power from his father in late 2011.

Just about a month before the Singapore summit, Xi and Kim held a surprise meeting again in the northeastern Chinese city of Dalian, fueling speculation that the two leaders made some deals beforehand.