(Bloomberg) -- Spain’s Prime Minister Pedro Sánchez, written off numerous times since taking office in 2018, is grabbing the political lifeline unwittingly thrown his way by Donald Trump.

The prime minister’s inner circle believes his opposition to the war in Iran — and to Trump — could put the government on a path toward an unlikely electoral recovery ahead of 2027, when the next general election is due. 

“It’s a clear opportunity,” said Cristina Monge, a politics professor at Complutense University of Madrid. “Spain is an openly pacifist country. If international tensions persist or escalate and everything revolves around Trumpism, Sánchez can present himself as the alternative.”

The US president on Tuesday issued a sharp rebuke of Spain, calling it a “terrible” ally and threatening to “cut off all dealings” over its refusal to allow the US to use its two military bases in the country for the offensive in Iran. “They have great people, but they don’t have great leadership,” Trump said.

That gave the Socialist Sánchez a chance to engage in the patriotic theater typically dominated by the right. This Thursday, senior party officials have even worn T-shirts bearing the Spanish flag — a symbol usually claimed by conservatives — to a parliamentary session and a minister made it their profile picture on social media.

“We are not going to be complicit in something that is harmful to the world and contrary to our values and interests simply out of fear of someone’s retaliation,” Sánchez said in a speech Wednesday. It is “naive,” he added, to think that “blind and servile compliance is a way to lead.”

Officials close to Sánchez say that they believe that each time Trump attacks the Spanish government, it gives them a bump in the polls. At the same time, the prime minister is not actively seeking confrontation with the White House, said the officials, who asked not to be named discussing private analysis. 

Sánchez has repeatedly clashed with the US since Trump’s return to office last year. He was the only NATO leader to reject new targets for defense spending, he pledged a crackdown on social media platforms and enthusiastically pursued closer ties with China. 

After sliding in the polls last year, Sánchez’s Socialist party has stabilized at around 28%, according to recent surveys by 40db. That’s about two points behind the main center right opposition. However, a steady increase in support for the nationalist group Vox puts the right-wing bloc on course for a clear majority at the next election. 

According to a poll released this Friday, 68% of Spaniards oppose the US and Israeli strike on Iran, while only 23% openly support it. More respondents back Sánchez’s stance than disapprove of it, whereas the opposition leader—who has criticized the government’s position—receives poor ratings from those surveyed by 40db in a poll published by El País newspaper. 

Moreover, Trump is unpopular in Spain. Some 76% of Spaniards have a negative or very negative view of the US president, according to the official pollster. A separate survey by think tank Real Instituto Elcano gave Trump a rating of 2.5 out of 10 among Spaniards, lower than that of China’s president Xi Jinping.

“Looking at the polls published by various media outlets, it is clear that the Government of Spain is not only on the side of international law but also on the side of a very broad majority of Spaniards who are clearly expressing their opposition to this illegal intervention,” the prime minister said at a Friday press conference. 

Sánchez has noted Mark Carney’s rise in Canada, where he gained in the polls after refusing to yield to Trump’s threats, offficials said. Support from leaders such as Emmanuel Macron and from European institutions also helps, Monge said, because it shows Sánchez is not alone.

Sánchez himself has invoked the spirit of the 2003 “No to War” protests that brought hundreds of thousands onto Spain’s streets. At the time, conservative Prime Minister José María Aznar aligned with US President George W. Bush in the overthrow of Saddam Hussein over alleged weapons of mass destruction.

Three days before Spain’s 2004 general election, a jihadist attack killed nearly 200 people in Madrid. Aznar’s government initially played down evidence of the perpetrators’ identity, a move that contributed to an unexpected Socialist victory.

More stories like this are available on bloomberg.com

©2026 Bloomberg L.P.