Iran and China signed what state television called a "25-year strategic cooperation pact" on Saturday as the US rivals move closer together.
The agreement, which has been kept almost entirely under wraps, was signed by the two countries' foreign ministers, Mohammad Javad Zarif and Wang Yi
The pact includes "political, strategic and economic" components, Iranian Foreign Ministry Spokesperson Said Khatibzadeh told state television ahead of the signing.
"We believe this document can be very effective in deepening" Iran-China relations, the spokesperson said, recalling that the pact had first been proposed during a visit to Tehran by Chinese President Xi Jinping in January 2016.
China is Iran's leading trade partner and was the biggest buyer of Iranian oil before then U.S. President Donald Trump reimposed sweeping unilateral sanctions in 2018 after abandoning a nuclear agreement with Tehran.
Xi and his Iranian counterpart Hassan Rouhani agreed then to establish a roadmap for "reciprocal investments in the fields of transport, ports, energy, industry and services."
"Iran's government and people are striving as they always have to broaden relations with trustworthy, independent countries like China," supreme leader Ayatollah Ali Khamenei said at the time, describing the proposed cooperation agreement as "correct and reasonable."
A signing ceremony hosted by Iranian Foreign Minister Mohammad Javad Zarif is set for midday.
In July last year, controversy erupted over the proposed deal after former president Mahmoud Ahmadinejad charged that negotiations were being held for a "new, 25-year agreement with a foreign country" without the knowledge of the Iranian people.
The foreign minister was heckled in parliament when he assured lawmakers there was "nothing secret" in the proposed deal, which he promised would be publicly announced "once it has been finalized."
The government has yet to honor that promise and few details have been made public.
The deal forms part of China's trillion-dollar Belt and Road Initiative, a plan to fund infrastructure projects and increase its sway overseas that has been a marquee project for Xi.
Wang's visit to Tehran comes just days after he hosted Russian Foreign Minister Sergei Lavrov for talks in the Chinese city of Guilin.
The three governments all face difficult relations with Washington after President Joe Biden's administration vowed to remain firm in its dealings with them, despite a new emphasis on diplomacy.
China and Russia are both parties to the troubled 2015 nuclear accord with Iran that Biden has said he hopes to revive.
They were both deeply critical of the unilateral sanctions on Iran reimposed by Trump and have backed efforts to revive the agreement.
Biden has said he is not seeking "confrontation" with China, but that there will be intense competition between the rival superpowers.
"I told him (Xi) in person on several occasions we're not looking for confrontation, though we know that there will be steep, steep competition," the U.S. president said.