(Bloomberg) -- Spanish Prime Minister Pedro Sánchez urged China’s president, Xi Jinping, to speak with his Ukrainian counterpart if Beijing wants to play a role in ending Russia’s invasion.  

“We all want peace, but we want that peace to be just and lasting, and for that to happen it has to be based on the position of the country that is being attacked,” Sánchez told reporters on Friday after meeting Xi. 

Spain is in line with the European Union in supporting Ukrainian President Volodymyr Zelenskiy’s blueprint to end the hostilities released a few months ago, Sánchez added, rebuffing Xi’s plan that would freeze in place territory seized by Russian forces. 

In the meeting with Sánchez, Xi called on relevant parties to a build “a balanced, effective, and sustainable security framework in Europe” through dialog to settle the crisis in Ukraine, according to state broadcaster CCTV. He also said he hoped Madrid could play a role in promoting China-Europe ties. 

Sánchez’s visit comes just days before a planned trip by French President Emmanuel Macron and European Commission President Ursula von der Leyen to China. The EU is balancing the need to keep dialog open with China while tackling its expansionary ambitions on issues including trade, technology and foreign relations.

Xi’s contentious Chinese proposal for a cease-fire after Russia’s invasion of Ukraine received a lukewarm reception from the US and Europe, which are wary of Beijing’s close ties with Russian President Vladimir Putin. 

On Thursday, von der Leyen said that China’s stance on Russia’s invasion of Ukraine will be “a determining factor” in EU-China relations.

With his first visit to China since taking office, Sánchez also sought to reduce Spain’s trade deficit with the Asian giant by bringing down non-tariff barriers and to bring Chinese investors into its electric automotive project as well as bolstering the number of tourists visiting the Southern European nation. 

Spain’s trade deficit with China widened 37% to €41.6 billion ($45 billion) in 2022 from a year ago, making Beijing its key provider of inputs and goods, according to trade ministry data.

Xi said his country is willing to import more quality products from Spain and that he hopes that Spain will provide a fair and just business environment for Chinese companies, according to a report by CCTV on the meeting with Sánchez.  

The Spanish government also wants access to China’s rare earth minerals, which are key to produce batteries as Spain plans to spend billions of euros in building up an electric vehicle industry. 

--With assistance from Lucille Liu, Jing Li, Alonso Soto and John Follain.

(Updates with Xi comments in fourth and tenth paragraphs)

©2023 Bloomberg L.P.