Chinese leader Xi Jinping and French President Emmanuel Macron declared on Wednesday that the Paris climate pact was "irreversible", showing a united front after Washington formally withdrew from the accord this week.

The joint declaration came at the end of Macron's second visit to China, which started on Monday in Shanghai and included talks on trade and the Iranian nuclear issue.

The French leader also said he told Xi there was a need for dialogue to resolve months of unrest in Hong Kong -- ignoring Beijing's prior warning that such sensitive topics should not be on the agenda.

But Xi and Macron found common ground on climate change.

Major powers expressed regret and concern after President Donald Trump went ahead with the US pullout from the Paris accord despite mounting evidence of the reality and impact of climate change.

Washington presented its withdrawal letter to the United Nations on Monday, the first possible date under the accord negotiated by Trump's predecessor Barack Obama, making the world's largest economy the sole major outlier from the agreement.

In a joint written statement, Xi and Macron reaffirmed "their firm support for the Paris accord which they consider as an irreversible process and a compass for strong action on climate".

Without directly naming the US, Macron said he "deplores the choices made by others" as he sat next to Xi following the talks at the imposing Great Hall of the People in the Chinese capital.

"But I want to look at them as marginal choices," Macron said.

With the European Union, China and Russia backing the pact, he added, "the isolated choice of one or another is not enough to change the course of the world. It only leads to marginalisation."

- 'Law of the jungle' -

In his remarks, Xi took a veiled swipe at the United States, which launched a trade war with China last year and has angered Beijing on various diplomatic issues.

"We advocate for mutual respect and equal treatment, and are opposed to the law of the jungle and acts of intimidation," Xi said.

Story continues

"We advocate for openness, inclusion and for mutually beneficial cooperation, and are opposed to protectionism and a zero-sum game."

China's efforts against climate change are key as it is the world's biggest emitter of greenhouse gases.

Xi also called on the international community to "jointly protect our homeland planet Earth", saying "we are against the attempt to place national interests above the common interests of humanity".

In a document titled the "Beijing Call for Biodiversity Conservation and Climate Change", the two leaders voiced their determination to improve international cooperation to "ensure a complete and efficient implementation of the Paris accord".

The document includes a commitment to restoring almost a third of degraded land as well as eliminating fossil fuel subsidies in the medium term.

- Unrest in Hong Kong -

After the meeting, Macron said at a news conference at the French embassy that he had raised the unrest in Hong Kong during his talks with Xi.

"I obviously conveyed our concerns, which are shared by Europe," Macron said, adding that he told Xi that there was a need for "de-escalation through dialogue."

The international finance hub has been convulsed by five months of huge and increasingly violent protests calling for greater democratic freedoms.

A Chinese foreign ministry official had warned prior to Macron's visit that Hong Kong was a matter of China's internal affairs and should not be on the diplomatic agenda.

But it did not stop the two sides from striking deals, including an agreement to protect 200 European and Chinese agricultural products -- whose names are tied to their regions -- against counterfeiting, from Champagne to Feta cheese and Panjin rice.

The two sides also committed to signing by January 31 a contract for the construction of a nuclear fuel recycling plant in China, which would involve French energy giant Orano.

On Iran, Macron said the two countries agreed to deepen joint efforts to convince Tehran to "fully respect its obligations" under the 2015 nuclear deal with major powers.

Washington's abandonment of the agreement in May last year followed by its reimposition of crippling sanctions prompted Tehran to begin a phased suspension of its own commitments.

President Hassan Rouhani said Tuesday that Iran would resume uranium enrichment at an underground plant south of Tehran -- a move Macron decried as "grave".