Henry Kissinger said in the Middle East there is no war without Egypt and no peace without Syria. China is heeding this famous dictum.

Back in July while Secretary Kerry was in Paris with Qatar and Turkey hatching a Cease-Fire plan for the Hamas-Israeli conflict, China’s Mid-East envoy Wu Sike was in Cairo proclaiming Beijing’s firm support of the Egyptian proposal.

In the aftermath of the failed Kerry-supported plan and renewed outbreak of violence, in August Egypt announced another Cease-Fire proposal that China supports while U.S. and Qatar were at it again to hatch an alternative plan.

Increasingly, a new Mid-East geopolitical realignment appears to be unfolding with Egypt, Israel, PA and moderate Arab states on one side that is supported by a rising China, and a more Islamist-oriented axis of Qatar, Turkey and Hamas that is supported by the U.S.

On the war against terrorism and Islamic extremism, China seems to be emerging as its champion in the Middle East while U.S. influence continues to retrench. Jacob Zenn, a counter-terror expert with the Washington-based Jamestown Foundation, said terrorism would likely dominate Chinese President Xi Jinping’s leadership in much the same way it did with President George W. Bush.

Beijing is currently struggling with its worst series of terrorist attacks in a decade. On July 29, almost 100 people were killed in Xinjiang, and Wu Sike emphasized Xinjiang terror groups have strong ties to al-Qaeda linked militants in Syria and Iraq. Turkey and Qatar support some of these groups.

In July 2013 China’s state press Global Times also accused Xinjiang terrorists of finding training and support in Syria and Turkey. Beijing pointed out Turkic Uyghurs were being recruited by East Turkistan Islamic Movement (ETIM) working alongside the Istanbul-based exile group East Turkistan Educational and Solidarity Association (ETESA), and being sent across the border to train in Syria with al-Qaeda affiliates

Li Wei, an anti-terrorism expert with the Chinese Institute of Contemporary International Relations, said recent terror attacks showed that “East Turkistan secessionist terrorists had copied the international mode and used it in Xinjiang,” while Meng Hongwei, vice minister of public security, likewise warned Xinjiang terrorism was being influenced by overseas jihadists.

Indeed another Xinjiang-based terror group, Turkistan Islamic Party (TIP), has raised its profile among al Qaeda and other jihadists groups. TIP propaganda material is being coordinated by Al Fajr, an al Qaeda jihadist media forum, and TIP leader Abdullah Mansour has laid out grievances against China and compared Xinjiang to other areas where jihadists are fighting such as Palestinian territories, Kashmir and Syria. Al Qaeda leader Ayman al-Zawahiri now mentions “East Turkistan” among other jihadists battlegrounds, and TIP has praised Syrian jihadists for combating the China-backed Assad regime.

As such, there is growing Chinese alarm over the spread of militant Islam among Chinese Muslims, especially by foreign sponsors. This concern is even straining China’s relationship with its “all-weather friend” Pakistan. According to Andrew Small, a China scholar at the German Marshall Fund, Beijing is becoming wary of Islamabad’s support of militant Islam and Uyghur terror groups in the tribal area.

While Beijing still trusts the top ranks of the Pakistani army, it worries about the younger generation that came through the “Islamization” of Pakistan’s society and army in the last 35 years. “We’re not concerned about the generals, we’re worried about the brigadiers”, said a Chinese analyst. Chinese officials also privately complain “When we provide them with intelligence on ETIM locations they give warnings before launching their attacks.”

Just as Turkic Uyghurs is a hot button issue for China-Pakistan relations, it is also an irritant in China-Turkey relations. Muslim Turkey shares linguistic and religious links with Uyghurs, and Turkish nationalists see Xinjiang as the easternmost frontier of Turkic ethnicity. Furthermore, it does not allay China’s underlying suspicions of Ankara’s support for Uyghurs that Turkey’s previous president Turgut Ozal wanted “a Turkic world from the Adriatic Sea to the Great Wall.”

Bilateral relations reached a nadir when China cracked down on the Uyghur uprising in 2009. Prime Minister Erdogan angrily declared, “The incidents in China are, simply put, a genocide. There’s no point in interpreting this otherwise, ” and Minister of Industry Nihat Ergun Cin advised the public to boycott Chinese products.

Since 2009, Beijing and Ankara have tried to improve ties. This culminated in Erdogan’s visit to Xinjiang in 2012 when he declared to Beijing officials, “I entrust my kin to you.” In light of heightened sensitivity over the Uyghur issue against the recent backdrop of Xinjiang violence and Beijing’s swift clampdown, even banning fasting during Ramadan, China would closely watch Turkey’s reaction towards Israel’s counter-terror efforts in Gaza. China and Israel recently upgraded their counter-terrorism cooperation.

During his recent campaign, Erdogan presented himself as the sole Muslim leader standing up for the Palestinians and accusing Israel of genocide. This then begs the question for China—if Erdogan stands up for Arab Palestinians, how much more would he stand up for Turkic Uyghurs as Beijing ramps up its counter-terror efforts in Xinjiang.

Thus China is turning to Egypt—still the largest and influential country in the Arab world. On August 3 when Chinese Foreign Minister Wang Yi met Egyptian President al-Sisi in Cairo, he pronounced China’s support for Egypt’s Cease-Fire proposal and discussed regional counter-terrorism efforts in the Middle East spanning from Libya, Syria and Iraq. In the wake of strained U.S.-Egyptian relations post-Arab spring and post downfall of Muslim Brotherhood’s Morsi, China and Egypt are stepping up their strategic partnership.

Back in 2011, Secretary Clinton accused China of “standing on the wrong side of history” after vetoing a Western blueprint for Syria at the UN Security Council. Now, given Secretary Kerry’s support of Qatar and Turkey’s pro-Hamas blueprint, for Beijing, U.S. may in fact be on the wrong side of history.