Spanish Prime Minister Pedro Sanchez begins Thursday a visit to China he hopes will show Spain has gained global influence under his watch ahead of a tight year-end general election.
The two-day visit comes as Spain is gearing up to take over the European Union's rotating presidency in July which will also serve to project the country on the world stage.
Sanchez will attend the high-profile Boao Forum for Asia on the Chinese island of Hainan on Thursday before meeting with Chinese President Xi Jinping in Beijing.
He will be only 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 said last week that Xi's invitation proves "the international recognition given to Spain during a time of such complex geopolitical difficulties."
Sanchez's talks will focus on the Ukraine conflict, with Xi trying present himself as a mediator.
The world should listen to China's "voice" in order to find a way out of the war in Ukraine, Sanchez said on Friday ahead of his visit to Beijing.
Spain is not "in the first division of global actors" and is not "decisive regarding strategic issues relating to China or Russia," said Jose Ignacio Torreblanca, a senior fellow with the European Council for Foreign Relations.
But the country has "easy" ties with Beijing and it "could act as a facilitator," he told AFP.
Sanchez, a socialist, has made international affairs a priority since he came to power in June 2018, in contrast to his conservative predecessor.
Spain lost influence in the EU, especially during the country's deep economic downturn sparked by the 2008 global financial crisis, said Raquel Garcia, an analyst with Madrid's Elcano Royal Institute, a think tank.
But in recent years Madrid has had "a much more pro-active attitude when it comes to defending its positions, presenting its ideas" in Brussels, she added.
Sanchez managed in 2019 to get his then foreign minister, Josep Borrell, named as the EU's foreign policy chief.
The Spanish premier has also taken advantage of "the loss in leadership of the Franco-German axis" to present Spain as a country that can "make the difference when it is time to form alliances," said Garcia.
Sanchez has been a staunch ally of Ukraine and has visited the country twice since Russia's invasion.
Despite being on the other end of Europe, Spain has welcomed 165,000 Ukrainian refugees, according to Eurostat.
Within the EU, only Poland, Germany and the Czech Republic have received more.
"Spain is not part of the G7 and is only invited as a guest to G20 meetings. It is in Europe where it can best exercise a certain form of leadership," said Garcia.
Having a clear position on Ukraine is "a way to reinforce his leadership" on "the issue which is central in the EU", she added.
Spain's upcoming presidency of the EU will also be the focus of Sanchez's talks with Xi.
"China wants to obtain precise things from the European Union and wants to get closer to Pedro Sanchez" for this reason, said Torreblanca.
Sanchez's taste for diplomacy could also be an asset in the run-up to a general election expected in December, even if the campaign will not focus on international relations.
"The temptation exists to take advantage of foreign policy for electoral purposes for a very simple reason: it's a subject where the opposition does not act," said Torreblanca.
Most polls put the main opposition conservative Popular Party (PP) several percentage points ahead of Sanchez's Socialists.