Ties between China and Germany are about to enter a new phase, China’s president said, as he met the German chancellor Angela Merkel before a G20 summit that is expected to highlight their differences with the United States on a host of issues.

President Xi Jinping and Ms Merkel pledged to work together more closely on a range of issues, two days ahead of the G20 summit in Hamburg that US President Donald Trump is also due to attend.

Mr Trump’s testy relationship with both China and Germany is pushing the two countries closer together, despite Berlin’s concerns about human rights in China and frustrations over market access.

“Chinese-German relations are now about to have a new start where we need new breakthroughs,” Mr Xi told a joint news conference with Ms Merkel in Berlin. He said he hoped to make a “new blueprint, set our sights on new goals and plan new routes” for cooperation during his visit to Germany.

“We will have difficult discussions, since bringing 20 states together with all their developments and ideas is not easy,” Ms Merkel said.

Tension is likely both at the summit and outside it. Thousands of protesters are expected to demonstrate for a raft of causes, ranging from anti-globalisation to failure to tackle climate change. Already, German police have used water cannon to disperse around 500 anti-capitalist protesters.

Much of the tension will revolve around Mr Trump. In an article for German newspaper Handelsblatt, Japanese Prime Minister Shinzo Abe urged the G20 states to continue working together on climate protection, after Mr Trump pulled the United States out of the 2015 Paris agreement on climate change policy.

And World Bank President Jim Yong Kim told Handelsblatt he agreed with Ms Merkel on climate change, saying: “We cannot wait”. In contrast to Mr Trump's protectionist stance, Mr Kim also stressed that free trade was key to alleviating poverty and boosting prosperity.

Ms Merkel has lashed out at Trump’s administration for taking the view that globalisation is creating winners and losers. She told the newspaper Die Zeit that as G20 president, she had to work on reaching agreement rather than contributing “to a situation where a lack of communication prevails”.

To symbolise their close ties, Ms Merkel and Mr Xi opened a garden at the Berlin Zoo for Meng Meng and Jiao Qing, two giant pandas on loan from China who were seen sitting on wooden benches munching bamboo when a red curtain covering their enclosure was opened. Ms Merkel described them as “two very nice diplomats”.

German parliament votes to legalise same-sex marriage, Angela Merkel votes against

Ms Merkel said she and Mr Xi had also talked about wanting to quickly sign an investment treaty that would ultimately turn into a full-blown free-trade agreement. They discussed as well improving cooperation on cyber security and working more closely together on fighting international terrorism.

In addition, they discussed bilateral cooperation in countries such as in Africa and Afghanistan, with Ms Merkel highlighting an agreement to jointly build a hydroelectric power plant in Angola.

But she added: “In my view we must intensively pursue the human rights dialogue, looking at how different parts of society can better express themselves. In this respect, cooperation in the field of civil society can be further strengthened.”