Switzerland earned a 2-1 win over Spain in the Nations League on Saturday in Zaragoza to knock Luis Enrique's side off top spot in the group.
Portugal thrashed the Czech Republic 4-0 in the other League A Group 2 clash to move two points clear of Spain, whom they host on Tuesday in the final group match.
It was Spain's first defeat in the group in five games, and one which exposed their defensive frailty from set-pieces.
Luis Enrique selected six Barcelona players in his starting line-up, including the regular midfield trio Xavi Hernandez utilises at Camp Nou, in Pedri, Gavi and Sergio Busquets.
Ferran Torres was another of the Barca clan, part of a three-pronged attack alongside Real Madrid's Marco Asensio and Paris Saint-Germain's Pablo Sarabia.
None of the three have enjoyed regular football with their clubs this season but were given Luis Enrique's trust. They did not repay it in the first half, with Spain anaemic in attack and asleep at the back when it mattered most.
Switzerland took the lead when Manchester City summer signing Manuel Akanji got the better of Cesar Azpilicueta in the air at a corner and nodded past Unai Simon in the 21st minute.
Spain struggled to create at the other end and Switzerland almost doubled their lead when veteran midfielder Xherdan Shaqiri cut through the defence and forced Simon into a smart save shortly before the interval.
The crowd grumbled, unimpressed at a drenched La Romareda stadium, in a city where Spain had not played since 2003.
Asensio had them out of their seats early in the second half when he created the Spain equaliser with an electric burst forward, before playing in Jordi Alba to finish clinically.
However, three minutes later Spain defended a corner poorly again and Akanji's flick-on was nudged over the line by Breel Embolo to restore the Swiss lead.
Defending set-plays was a serious issue for La Roja at Euro 2020 and it clearly remains one as the World Cup approaches.
Luis Enrique replaced his entire forward line, with debutant Borja Iglesias drawing huge applause at his former hunting ground, while Nico Williams also earned his first cap, a night after his older brother Inaki Williams made his debut for Ghana.
Athletic Bilbao forward Williams almost forced the equaliser when his cross was turned towards his own goal by Silvan Widmer, but Yann Sommer reacted quickly to keep the ball out.
The goalkeeper produced another solid save, punching away substitute Marcos Llorente's fierce drive as Spain began to threaten more.
Villarreal winger Yeremy Pino was bright on the right flank but even his spark fizzled out in the rain, and Sommer stayed alert until the end to deny Carlos Soler.
Luis Enrique's side, the 2021 Nations League runners-up, must now beat Portugal in Braga on Tuesday if they want to reach the final four again.