QINGDAO, China (Reuters) - Iranian President Hassan Rouhani criticised U.S. “unilateralism” in withdrawing from the Iran nuclear deal and said on Sunday he appreciated efforts by China and Russia to maintain the agreement.

“The U.S. efforts to impose its policies on others are expanding as a threat to all,” Rouhani told the summit of the Shanghai Cooperation Organisation (SCO), a regional security grouping led by China and Russia where Iran has observer status.

“The recent example of such unilateralism and the defiance of the decisions of the international community by the U.S. government is its withdrawal from the JCPOA,” he said, referring to the nuclear agreement by its official name, the Joint Comprehensive Plan of Action.

The 2015 agreement between Iran and world powers lifted international sanctions on Tehran. In return, Iran agreed to restrictions on its nuclear activities, increasing the time it would need to produce an atom bomb if it chose to do so.

U.S. President Donald Trump withdrew the United States from the agreement last month, calling it deeply flawed, and European states have since been scrambling to ensure Iran gets enough economic benefits to persuade it to stay in the deal.

Chinese President Xi Jinping, speaking after Rouhani, expressed “regret” that Washington had withdrawn from the nuclear deal.

“China is willing to work with Russia and other countries to preserve the JCPOA,” Xi said.

Meeting Rouhani on the sidelines of the Qingdao conference, Xi said separately the nuclear agreement helped promote peace and stability in the Middle East and nuclear non-proliferation.

“It should continue to be implemented effectively,” Xi said, according to a read-out of the meeting on the Chinese foreign ministry website.

Reporting by Christian Shepherd and Shu Zhang; Additional reporting by Ben Blanchard in BEIJING and John Ruwitch in SHANGHAI; Writing by Tony Munroe; Editing by Michael Perry and Richard Pullin