Pedro Sánchez knows what to do to maintain his position. “I always use my elbows,” said Sánchez, Spain’s prime minister, laughing in the corner of a locker room as he used lessons learned from his time as a youth basketball player to describe his political game. There were minutes before a Socialist Party rally in southeastern Spain (in a packed gymnasium equipped with basketball hoops) and a dozen days before the national elections on November 29. Polls suggest Sánchez, Europe’s most prominent left-wing leader, will lose after eight years in office. But Sánchez, known as a political survivor, seemed to relish the idea of being discarded once again by favored conservatives. “That’s good for me,” he said in an interview before the rally, looking relaxed in a black turtleneck. “It’s a good tactic because at the end of the day they underestimate me.” Sanchez, 54, has beaten the odds in the past, but this time they are against him. Outside Spain, he has become a hero for the global left by resisting President Trump, welcoming immigrants and denouncing what his government called Israel’s genocide in Gaza, a term rejected by Israel. Under Sánchez’s leadership, Spain has become one of Europe’s fastest-growing economies and one of its most prolific users of renewable energy. He said it had put Spain “more in the conversation.” However, within Spain, many are fed up with him. He has become an increasingly polarizing figure after years of corruption scandals in his inner circle, a national electricity blackout in 2025 and a migrant crisis this summer in Ceuta, a Spanish territory in North Africa. He tried to capitalize on the left’s frustration over skyrocketing rents by calling for early elections and taking up the issue. But a horrific train crash halted the momentum that polls showed him gaining, diverted voters’ attention and raised troubling questions about his maintenance of the country’s infrastructure. Even the online chess games he plays to relax between campaign events are not going in his favor. His score of 700 on chess.com (among “the lowest,” he admitted) means his king is knocked down frequently. For most of his career, it has been a different story. Those despised by Sánchez, a highly disciplined activist, say his chiseled features and abundant charm mask a ruthless political instinct. He mostly ignored Trump’s regular attacks, using them to bolster his support for the left. He joked that even though the US president “said all those bad things about me,” Trump only talked to him about golf when they met privately. “It was strange,” he said, laughing. The White House declined to comment. Even Sánchez’s enemies do not believe in the polls. They are traumatized by his previous comebacks, including in 2023, when he managed to form a governing coalition despite his party failing to win the most votes. According to what Sánchez says, winning has never been more important. Polls suggest the conservative Popular Party is likely to take power after the election, in a coalition for the first time with the far-right Vox party. “The danger is that the last time the far right was in power in my country was during the dictatorship,” Sánchez said, suggesting that a coalition of traditional conservatives and far-right forces risked sending Spain back to the authoritarian government of Francisco Franco, who died in 1975. Alluding to the Spanish Civil War that installed Franco, he added, “we of course had all these terrible situations in the past.” For Sánchez’s enemies, this is a classic trick from a prime minister who they portray as the main cause of Spanish social divisions. They consider his use of civil war imagery (he filmed a political ad opposite Pablo Picasso’s “Guernica,” depicting the horrors of war) to be inflammatory. “Less civil war, less hatred among Spaniards, less rubbish from a century ago,” said Santiago Abascal, leader of Vox, who has called Sánchez a “dictator,” a “traitor” and worse, at a rally in the Canary Islands on Tuesday. Sánchez equates Vox, which is anti-immigrant, nationalist and has challenged the acceptance of LGBTQ rights in Spain, with the conservative Popular Party. “Today,” he said, “they are more or less the same.” His intention is to use the possibility of a union between Vox and the Popular Party to mobilize his left-wing base and attract supporters of far-left parties because they think he is their only chance to avoid a right-wing government. But Sánchez also needs to back off Spain’s centrist voters exasperated by appearing more moderate. “This is a true referendum in favor of good politics,” Sánchez said from the stump Tuesday night in Albacete, southeastern Spain. “And against incivility.” The event capped a busy couple of days during which I followed Sánchez during the election campaign, including at the Moncloa Palace, the headquarters of the Spanish prime minister. I ate churros with his ministers at a weekly breakfast behind closed doors and caught Sánchez joking with his assistants about a right-wing media conspiracy that described him as possessing secret tapes to drop on the opposition before election day. During a visit by Brazilian President Luiz Inácio Lula da Silva, fresh off his own electoral victory, I stood with Sánchez on the steps of Moncloa as we watched the Brazilian leader delay the departure of his caravans so he could record a video under the branches of a 600-year-old olive tree. Lula had come to energize Sánchez’s campaign. The two leaders drove to central Madrid to film a conversation that had the feel of a mutual admiration society. Sánchez’s campaign quickly broke it down into clips for social media to motivate left-wing supporters. On the sidelines, André Janones, the architect of Lula’s comeback victory, applauded as Lula signed the red T-shirts of Sánchez’s “People’s Power” campaign. “Now it is Spain’s turn to maintain this momentum,” he told me. And since Europe is so bereft of left-wing leaders, he said, a “much greater responsibility” fell on Sánchez. The most difficult task for Sánchez involves bringing back the moderates. To reach them, he replaced his far-left deputy prime minister with a more moderate economist and took to waving Spanish flags, long a conservative symbol, at rallies. On Tuesday night, he stopped by the studios of Telecinco, a popular television network considered lukewarm by the Spanish left. Before his interview, Sánchez oozed confidence, speaking with an executive, Francisco Moreno, about how he used to play basketball in Converse sneakers. But as the interview began, the journalist dwelled heavily on Sánchez’s political setbacks (“Evolutions,” the prime minister called them) and asked difficult questions about railway maintenance and Sánchez’s decision to take a vacation during a migration. crisis. Sanchez became enraged after the interviewer rushed his answers so they would have more time to discuss corruption scandals involving the prime minister’s associates. “You can talk,” Sánchez snapped. “I also have the right to speak.” When Sánchez came out, his lips tightened in a seemingly forced smile. He shook Mr. Moreno’s hand again and left. “The way television interviews should be,” Moreno said as he entered an elevator. The next morning, in a Moncloa breakfast room adorned with Spanish abstract art, Sánchez’s ministers drank coffee from gold-rimmed mugs emblazoned with the Spanish coat of arms and said their boss had behaved well, considering the forum. Several continued where Sánchez had left off. “Europe needs a strong progressive voice that continues to believe in European values,” said José Manuel Albares, the foreign minister, between bites of Spanish cake. Other members of the government said they felt a sense of momentum and were trying to create it, too. Minutes later they met with Sánchez in a room across the hall where they increased the minimum wage and increased the salaries of public servants. Later that night, in the locker room, Sánchez, again in good spirits, continued his basketball metaphors. He said that “you have to deliver” in the short time you have the ball, something he suggested other left-wing leaders could learn. Moments later it was time to deliver again. He entered the packed gym, while his followers waved socialist, Spanish, European and Pride flags. They applauded his litany of achievements and whistled at the mention of his right-wing opponents. “Sánchez beat us all,” Pedro Arnas, 68, said after the event. But in the country, he said, “it’s going to be difficult.” Carlos Barragán contributed reporting.