Beijing is stepping up efforts to strengthen ties to Europe, with China saying its relationship with Spain is the best in history and calling for greater cooperation with Germany and France.
Spain rolled out the red carpet for Chinese President Xi Jinping, who is seeking allies as trade clashes with Washington raise the temperature of international relations.
Heads of state Xi and King Felipe VI reviewed a guard of honour at the royal palace in Madrid on Wednesday, while Xi's wife Peng Liyuan and Spain's Queen Letizia watched the formalities from a podium.
In his meeting with the king on Tuesday, Xi said relations between China and Spain were the "best in history".
"We should continue to support each other on the issues of core interests and big concerns," Xi was quoted by state-run Xinhua as saying, suggesting more cooperation on trade, tourism and third-party markets under China's "Belt and Road Initiative" framework.
The Chinese president will follow his two-day visit to Spain by flying to Argentina on Thursday for a G20 leaders' summit the next day, and then visit Panama and Portugal until December 5.
In addition to Xi, other senior Chinese officials are stepping up engagement with Europe as China seeks to stabilise its external relations while it is locked in a trade war with the United States.
At an economic forum in Hamburg, Germany, Vice-Premier Liu He called on Germans to work with China against unilateralism and protectionism.
Spanish Prime Minister Pedro Sanchez (back C-R) and Chinese President Xi Jinping (back C-L) look at Chinese Foreign Minister Wang Yi (L) and his Spanish counterpart Josep Borrell (R) as they sign agreements between the two countries at the Moncloa Palace in Madrid on November 28, 2018. AFP-Yonhap
Liu met German Chancellor Angela Merkel during his four-day visit. He brought a message from Xi to Merkel that China "is willing to cooperate closely with Germany to enrich the strategic connotations of bilateral cooperation and strive to promote global economic governance, safeguard multilateralism and free trade, and build an open global economy".
China believed protectionist and unilateral approaches brought more economic uncertainty, not less, Liu said.
Foreign Minister Wang Yi, who accompanied Xi to Spain, discussed the G20 summit in Argentina with his French counterpart, Jean-Yves Le Drian, by phone on Wednesday.
Xi and French President Emmanuel Macron are to meet in Buenos Aires. Xi and Macron met during the French president's state visit to China in January, when trade was high on the agenda.
The Vice Premier of the People's Republic of China Liu He (R) talks with German Transport Minister Andreas Scheuer (C) and Hamburg's mayor Peter Tschentscher (L) at the Chamber of Commerce in Hamburg, northern Germany, on November 27, 2018. Liu He is in the Hanseatic city to attend "The Hamburg Summit: China meets Europe" conference. AFP-Yonhap
Wang and Le Drian both promised to push forward the agenda of climate change and give momentum to the next Conference of Parties of the United Nations Framework Convention on Climate Change ? known as COP 24 ? which will take place in Poland next month.
In 2016, Donald Trump said that if he were elected US president he would withdraw from the Paris Accord on climate change. The US will abandon the accord in November 2020.
Xi will have important meetings at the G20, including one with Trump to discuss the US-China trade war, as well as European leaders.
"It is critical timing ? all sides would hope for a fruitful summit and are preparing," said Cui Hongjian, head of European studies at the China Institute of International Studies.