Spain's conservative ex-prime minister Mariano Rajoy faced criticism at home and in France Sunday after saying the neighbouring country's national football team had "no French players".

The comment, published in an opinion piece in Spanish online news site El Debate, came as Spain prepares to face France Tuesday in a blockbuster World Cup semi-final.

Spain's current Prime Minister Pedro Sánchez condemned the remark as "xenophobic".

"There are those who still measure belonging by surname, place of birth, or skin colour. Others measure it by our roots in a country and our will to contribute to it," the Socialist leader wrote on X.

"Spain belongs to those who love it and work for it. Not to those who shame it with xenophobic statements."