"Spain wants to push for a balanced relationship with China based on reciprocity," said Sanchez at a press briefing in Beijing, adding that a China-Spain tourism forum will take place in June.
The 51-year-old is the second leader of a European country to visit China since the start of the Covid-19 pandemic three years ago, after German Chancellor Olaf Scholz's visit in 2022.
Sanchez encouraged Xi to talk to the Ukrainian leadership and learn first-hand about Kyiv's peace formula to help bring an end to Russia's invasion.
Sanchez said he had informed Xi, who visited Moscow on March 20-21, that Spain supported the proposals made by Ukrainian President Volodymyr Zelensky.
They include a demand to restore Ukraine's territory to the status quo before Russia's 2014 annexation of Crimea.
"I believe it's a plan that lays the foundations for a durable peace in Ukraine and is perfectly aligned with the United Nations charter and its principles, which have been violated by (Russian President Vladimir) Putin with his invasion," he said.
"I transmitted our concern over the illegal invasion of Ukraine," Sanchez said, adding that he "encouraged Xi to talk to President Zelensky".
Xi has tried to present himself as a mediator.
Macron has called on Beijing to help convince Moscow to end its year-long war in Ukraine. China has sought to position itself as a neutral party in the conflict, even as it has strengthened ties with Russia.
Beijing published a 12-point position paper in February calling for urgent peace talks and a "political settlement" to end the war.
Macron has said China's efforts are positive but the French leader insists peace can be achieved only if Russia withdraws its troops.
Macron said after the recent summit of EU leaders in Brussels that he had asked von der Leyen to come with him for part of the trip to present a "united voice" to China.
Von der Leyen has warned China that its approach to Russia's war in Ukraine would determine ties, but said Europe was not looking to "decouple" from Beijing.
"Far from being put off by the atrocious and illegal invasion of Ukraine, President Xi is maintaining his 'no limits friendship' with Putin's Russia," von der Leyen said during a speech.
Reacting to China's peace proposals, von der Leyen said any "viable" peace plan needed to be on Ukraine's terms and should not consolidate the Kremlin's grip over territorities it has seized.
"We have to be frank on this point. How China continues to interact with Putin's war will be a determining factor for EU-China relation," she said.
The EU is seeking to define its own approach to Beijing as the United States pushes its European allies to echo its tougher stand against China.