The Chinese government issued a joint statement with officials of Saudi Arabia in support of the Sunni government of Yemen under President Abd-Rabbu Mansour Hadi, days before President Xi Jinping is set to visit Iran, the main international support of the Shiite Houthi rebels.

“Both sides stressed support for the legitimate regime of Yemen,” the statement, released by the Chinese Foreign Ministry, read, detailing the meeting between Xi and Saudi King Salman bin Abdulaziz in Riyadh Tuesday. The “legitimate regime” of Yemen fled the capital, Sanaa, in January 2015 after the Shiite Houthi rebels invaded the city. Hadi then led the government‘s efforts against the Houthis from Saudi Arabia, and returned to southern Aden, Yemen in September.

Saudi Arabia launched an airstrike, and later ground, campaign in Yemen against the Houthi rebels in March 25 that continues today, while its regional rival, Iran, continues to support the Houthi rebels. The intervention has brought Houthi forces close to direct combat with Saudi troops. In December, Houthi rebels fired a missile directly into Saudi Arabia, killing three civilians. The missile launched in the middle of a UN-brokered ceasefire, and was the only one of a series of missiles the Saudis failed to intercept. Reports indicate some of these missiles may have reached Houthi hands through North Korea.

While the Houthis and Sunni alliance troops continue to fight, Sunni terrorist groups like Al Qaeda and the Islamic State have been cementing their foothold on Yemeni territory controlled by neither Houthi nor Hadi. The Islamic State has even been able to expand its presence in Aden, despite Hadi establishing a base there.

China’s remarks on the Yemen civil war may potentially tip a scale Beijing has been delicately trying to balance for years as it attempts to maintain friendly relations with both Iran and Saudi Arabia. Asked about the remarks on Wednesday, Foreign Ministry spokesman Hong Lei emphasized China’s will to see peace in the region, so as to foster more reliable economic ties:

With peace and stability of the Middle East and the fundamental interests of the Yemeni people in mind, the Chinese side has been making active efforts to promote peace talks. It is hoped that Yemen would end conflicts, realize reconciliation, restore stability and achieve economic and social development at an early date. The Chinese side will always be on the side of peace in the Middle East and the Yemeni people.

Analysts for The Diplomat suggest that China may have expressed support for the Yemeni government over the Houthis both to ingratiate itself with Saudi Arabia and to remain consistent in supporting “stable” regimes over rebellion, having to quell its share of separatism in western Xinjiang province, Taiwan, and Hong Kong itself. “Defaulting to support for an existing government against a rebellion is simply China’s modus operandi, based on its strong preference for stability as well as its own fear of domestic opposition,” The Diplomat notes; “Second, and most crucially, China did not express support for Saudi Arabia’s use of force against the rebels; in fact, the joint statement went on to say that all sides in Yemen should avoid making decisions that increase chaos and further fracture the state.”

It also adds to China’s attempts to court growing credibility as a player in Middle Eastern violent struggles. China vowed to expand its role in fighting terrorism alongside Russia in December, and has since begun to train its Marines for counterterrorism operations abroad.