Pakistan's Prime Minister Imran Khan must be a dejected man after having had to swallow the diplomacy dose of China. He shouted at the top of his voice, attempted nuclear blackmail and threatened terror attacks in India - all over the Kashmir issue - protesting change in the constitutional status of Jammu and Kashmir.

In the last two months since the Narendra Modi government moved to scrap special status of Jammu and Kashmir under Article 370 of the Indian constitution, Pakistan's campaign against India received a positive response from two countries - China and Turkey. But both have now changed tack.

Turkey realigned with Indian position during UN General Assembly when President Recep Tayyip Erdogan told the world body that it was imperative to "solve the Kashmir problem through dialogue". China has done it now.

Interestingly, Turkey changed stance despite a meeting between Imran Khan and Erdogan while China did the same when Imran Khan and Pakistan Army chief General Qamar Javed Bajwa are in China on an official visit.

China, with which India has a separate Kashmir issue - of illegal occupation of Aksai Chin, has shifted its stand over Article 370 move in Kashmir that it held since August first week.

From opposing the Kashmir move by the Modi government and invoking UN resolution in the matter, China has now realigned itself with India's position that Kashmir issue is a bilateral matter between India and Pakistan to be settled through talks.

In pronouncing so, Chinese foreign ministry's spokesperson Geng Shuang contradicted the stand previously taken by Wang Yi. Between scrapping of the special status of Jammu and Kashmir and Tuesday's realignment, China had positioned itself on the Pakistani side of the Kashmir divide.

Reacting to scrapping of the special status of Jammu and Kashmir, China issued statements opposing the Article 370 move calling it a violation of Chinese sovereignty. Soon Pakistan's Foreign Minister Shah Mehmood Qureshi rushed to Beijing seeking China's support.

China responded positively to Pakistan with Wang Yi saying that the Kashmir issue "should be properly and peacefully resolved based on the UN Charter, relevant UN Security Council resolutions and bilateral agreement".

This was a clear departure from decades-old position that China held with regard to the Kashmir issue between India and Pakistan. China then forced a closed-door meeting of the UN Security Council over Kashmir but it ended in a snub to both China and Pakistan.

China did not stop there. Wang Yi raised the matter in his UN General Assembly speech in September invoking UN resolutions on Kashmir again. This drew sharp protest from India and came in the view of the upcoming second informal summit between Prime Minister Narendra Modi and China's President Xi Jinping.

The informal meeting is scheduled for October 11 and 12 at Mamallapuram in Tamil Nadu. Now, just ahead of Xi-Modi informal summit, China has done a course correction on the Kashmir issue. The remark made by Chinese spokesperson is fascinating to a question on Kashmir issue in the wake of Imran Khan's visit to China and Xi's impending visit to India.

"So you are paying attention to the Kashmir issue, right? China's position on Kashmir issue is clear and consistent," Geng told the reporter adding, "We call on India and Pakistan to engage in dialogue and consultation on all issues including Kashmir issue and consolidate mutual trust. This is in line with the interest of both countries and common aspiration of the world."

This was a significant shift in Chinese stance over Kashmir especially in the backdrop of strong displeasure conveyed by India to the Chinese leadership over its position in the UNGA.

However, this Chinese position may not be the final one. China is known to do the same in international diplomacy what many Indian politicians do in politics - take U-turn.

But for now, China has left its all-weather friend Pakistan in the lurch over Kashmir as the world opinion generally agreed with the Indian government's position that scrapping of the special status of Jammu and Kashmir under Article 370 was an internal matter of the country.

(Correction: China's President Xi Jinping's India visit begins on October 11 for informal meeting with Prime Minister Narendra Modi. The earlier version said Xi will visit on October 10.)