Spanish Prime Minister Pedro Sánchez has become the center of controversy after an opposition party used artificial intelligence (AI) to manipulate a campaign video, falsely depicting him wearing a Moroccan national football team jersey. The original 17-second video, released by Sánchez’s Socialist-led government during Spain’s current election campaign, showed the prime minister donning the Spanish national team jersey emblazoned with the number 19, associated with Lamine Yamal, a young footballer of Moroccan and Equatorial Guinean descent. Sánchez declared in the original clip that Spain is a “pluralistic and diverse country.”

The opposition People’s Party (PP), however, altered the video to make it appear as if Sánchez was wearing a Moroccan jersey. The modification, made public just one day after the original, did not disclose its AI origins, raising questions about whether it met European Union transparency standards on AI-generated content. The incident is the latest in a succession of AI-related controversies surrounding the PP, which previously drew criticism for releasing a deepfake video targeting Sánchez’s wife, Begoña Gómez.

This episode unfolded amid a highly polarized election campaign ahead of national elections scheduled for Sunday, which most polls indicate will see the PP, supported by the far-right Vox party, replace Sánchez’s government. The opposition has repeatedly focused on immigration and border security issues, contrasting with Sánchez’s emphasis on social policies such as housing, pensions, and women’s rights.

The controversy has its roots in earlier remarks by PP candidate Xavier García Albiol, who in a recent interview expressed disdain for Lamine Yamal's inclusion in the national team, citing the player’s youth and maturity. Albiol, who has a history of accusations related to racist rhetoric, stated he would prefer to wear the jersey of any other Barcelona player over Yamal. Sánchez responded by defending Yamal as part of Spain’s diverse identity.

Media analyst Raúl Martínez Corcuera, a lecturer at the University of Vic and collaborator with the anti-racist group SOS Racismo, described the PP’s AI video as an attempt to exploit anti-Moroccan sentiment for political gain. He suggested the video aimed to portray Morocco as a threat and spotlight immigration as a national security issue, framing the government as weak on border control. Martínez Corcuera also characterized the video as embodying “subtle racism,” using Morocco as an emblem of “the other” while questioning the place of minority ethnic citizens like Yamal within Spain’s national identity.

The AI-generated video altered Sánchez’s speech to make it seem as if he endorsed wearing the Moroccan jersey, aligning with the PP’s broader strategy during the campaign to depict Sánchez as overly accommodating to Morocco. PP leader Alberto Núñez Feijóo has indicated that, if elected, his first foreign trip as prime minister would be to Morocco to demand respect for Spain’s territorial integrity, a stance reflecting tensions related to migration management between the two countries.

The controversy recalls previous public debates in Spain about national identity and minority representation, such as former Prime Minister Mariano Rajoy’s widely criticized 2018 comment claiming that the French national team lacked “any French players,” a statement denounced as xenophobic by Sánchez and others.

Amid the backlash, Spanish media also highlighted technical errors in the PP’s video, including inaccuracies in replicating the Moroccan football kit. Notably, the altered video featured the number 10 jersey, which in Morocco is worn by Brahim Díaz, a Spanish-born Real Madrid player, underscoring the intertwined nature of Spanish and Moroccan identities.

As Spain approaches its crucial election, the incident underscores the growing role—and risks—of AI technology in political campaigns and the fraught discussions about national identity, migration, and diversity shaping the country’s political discourse.