China and Iran signed a deal over the weekend that their foreign ministers said was designed as a strategic partnership to last for the next quarter of a century.
The details have not been published yet, but the assumption is that China, in defiance of American sanctions, will buy Iranian oil. It will, in turn, invest some of its wealth in Iran. Sanctions have starved Iran of foreign investment.
It is the latest extension to China's vast infrastructure project, the Belt and Road initiative, which is creating the connections Beijing needs to continue its expansion as a global power.
Some Iranians were suspicious of China's motives when a draft of the co-operation agreement was leaked last year. Belt and Road deals are intended to benefit China most of all. Some that looked attractive have turned sour when smaller, poorer countries (and most countries are smaller and poorer than China) found they were in out of their depth.
Iran - smaller than China, but still a big country with huge natural resources and an activist foreign policy - is a different proposition.
The new deal will feed into Iran's face-off with the United States.
Both Iran and the Biden administration in Washington have declared that they would like the US to rejoin the agreement regulating Iran's nuclear activities, known as the Joint Comprehensive Plan of Action (JCPOA). Former President Donald Trump pulled the US out of the deal in 2018 and tried unsuccessfully to destroy it, claiming that far from stopping Iran getting a nuclear weapon it made the process much easier.
Both the Iranians and the Americans have been staring each other out, unprepared to be the one that blinks first in the negotiation.
Now that Iran has signed a strategic accord with China, which is also a party to the JCPOA, it will be hoping for more than simply increased oil sales, vital as they are to an economy that has been badly damaged by sanctions.
The deal should give Iran more leverage with the US.
President Biden, like his two predecessors, has tried to "pivot" away from the Middle East to the lucrative and strategically important Asia-Pacific region. In practice, it has been impossible, as there is too much in the Middle East that the US considers vital to its interests. One of those agenda items is Iran, and the nuclear ambitions that it claims not to have.
While the US has not performed its longed-for pivot and pulled back, it has not pushed forward either. Its reluctance to dig any deeper holes for itself in the Middle East has opened up opportunities for its rivals.
Russia saw space to revive the Soviet Union's old role by intervening in Syria.
China believes that the US is in a long-term, irreversible decline. It sees itself as the world's rising power of the 21st Century and beyond. A power of that magnitude cannot ignore the Middle East.
Strategic co-operation in the Gulf might have more significance for China's long-term ambitions than any short-term benefit banked by Iran.
Chinese Foreign Minister Wang Yi's Middle East tour was not confined to Tehran for the signing ceremony.
China Daily, an organ of the Chinese Communist Party, reports that he unveiled a five-point plan "for achieving security and stability in the Middle East by offering constructive boosts to Palestine-Israel dialogue, resuming the Iran nuclear deal and building a security framework in this region".
That is the kind of thing that Western diplomats say too. But the US has seen the Middle East as its preserve since the end of the Cold War. It has resisted allowing its allies in the European Union much of a role beyond signing cheques.
The Chinese People's Liberation Army has already built its first overseas military base on the Red Sea, in Djibouti. It overlooks one of the world's busiest shipping lanes and is only 10km (six miles) away from the home of the US military's Africa Command.
Could Beijing be planning something similar on Iran's Gulf coast, giving it a naval foothold in what the US Navy has regarded as its own lake?
Joe Biden and his administration might find a way back into the JCPOA. They judge it is in their best interests.
They will be much more uneasy about signs that China, as its rise gathers pace, is jostling its way into the world's most unstable region.