China and Iran struck a new accord Saturday for strengthening bilateral political and economic relations over the next 25 years, as the two countries are boosting cooperation to better navigate their complicated relationships with the United States.

The accord for comprehensive cooperation was signed by Iranian Foreign Minister Mohammad Javad Zarif and his Chinese counterpart Wang Yi during a meeting in Tehran.

Iranian President Hassan Rouhani (R) meets Chinese Foreign Minister Wang Yi (L) in Tehran, Iran on March 27, 2021.(Photo courtesy of Iranian Presidency/Handout/Anadolu Agency/Getty/Kyodo) 

Iranian President Hassan Rouhani, who also held talks with Wang, told the Chinese foreign minister that Tehran and Beijing "have very good ties and their shared stances on international issues are evidence of that," Iran's official Islamic Republic News Agency said.

As China and the United States have been increasingly becoming global rivals, Iran has remained at odds with the United States over a nuclear deal.

The Chinese and Iranian leaders also discussed the 2015 nuclear deal that Washington withdrew from nearly three years ago.

Under the deal originally struck with six major powers -- Britain, China, France, Germany, Russia and the United States -- Iran agreed to curb its nuclear activities in exchange for the lifting of sanctions.

But then U.S. President Donald Trump criticized the deal as flawed, pulling the United States out of it in May 2018. Iran has countered the U.S. move by increasing its nuclear activities, such as uranium enrichment, beyond the limits set in the deal.

China is in favor of the continued existence of the nuclear deal. Beijing has called on Washington to take concrete actions toward the lifting of sanctions while urging Tehran to comply with its obligations under the deal.