China is accelerating its efforts to end the Iran war, walking a diplomatic tightrope as it prepares for a summit next month with U.S. President Donald Trump while trying not to alienate Tehran.

President Xi Jinping’s mid-May meeting with Trump is shaping Beijing’s approach to the Middle East conflict even as the world’s top crude oil importer, reliant on the Middle East for half its fuel, seeks to safeguard its energy supplies, analysts say.

China’s modulated approach to the war has ?protected its back-channel leverage enough that Trump credited Beijing with helping to get Iran to last weekend’s peace talks in Pakistan.