In foreign affairs (as in life), birds of a feather flock together.

Just ask communist China, which just signed a $400 billion oil-for-cash deal with Iran — a sworn enemy of the United States that has repeatedly threatened to kill Americans.

Under the agreement signed Saturday, China will give $400 billion to Iran over the next 25 years in exchange for a steady, heavy supply of oil, according to The New York Times

Iran — the largest state sponsor of Islamist terrorism — has been financially crippled by the devastating economic sanctions imposed by former President Donald Trump in 2018 when he revoked the Iran nuclear deal signed by his predecessor, President Barack Obama.

China was one of six nations — along with Germany, France, Britain, the U.S. and Russia — that, along with the European Union, signed the Iran nuclear deal in 2015.

Ever since Joe Biden was installed as president two months ago, Iran has cozied up to China and urged the communist regime to pressure the United States to ease its sanctions.

This weekend, Chinese Foreign Minister Wang Yi did just that, declaring that the U.S. should immediately rescind its sanctions against Iran and issuing this statement: “China firmly supports Iran in safeguarding its state sovereignty and national dignity.”

Iran’s foreign minister, Javad Zarif, bragged about the “comprehensive strategic” alliance on Twitter.

Hesamoddin Ashena, an adviser to Iranian President Hassan Rouhani, gloated that the influence of the West (meaning the United States and Europe) is fading thanks to its new alliance.

“From now on, time is not in west’s favor,” he tweeted.

While Ashena claimed that “Trump’s strategy of maximum pressure failed,” in reality, it worked extremely well to financially hobble and isolate Iran during his presidency.

That’s why Iran — a Muslim-majority nation that has declared jihad on enemies of Islam — was forced to pander to China — which is accused of herding and mistreating 1 million Muslims in “re-education camps” — in exchange for financial and diplomatic aid.

Keep in mind that in France and other European nations, Muslims have beheaded civilians whom they just suspected had badmouthed the Islamic prophet Muhammad.

.Yet Iran has not condemned the CCP’s alleged brutality against Muslims in China.

What this means is that timid Iran is so financially paralyzed by Trump’s sanctions that it can’t afford to bite any hand that feeds it.

Zarif confirmed as much when he cooed after signing the trade deal: “China is a friend for hard times. The history of cooperation between two ancient cultures of Iran and China dates back centuries. Signing the cooperation agreement will further strengthen the ties of the two nations.”

Meanwhile, Biden has said he wants to resume the Iran nuclear deal at some point.

Just as his cancellation of the border wall and other policies undid the Trump administration’s success in stemming illegal border crossings, Biden is now reversing any progress the U.S. made to contain Iran’s nuclear threat.

If “America first” was the Trump doctrine, then the Biden doctrine appears to be “America last.”