An early goal from Pablo Sarabia earned Spain a 1-0 win in Switzerland on Thursday, their first victory of this year's UEFA Nations League.
Last year's finalists dominated the game from the start but were only able to score once, when Sarabia struck from close range in the 12th minute following a low cross by Marcos Llorente.
After a mistake by the Swiss defence, the Atletico Madrid winger found Sarabia ghosting in between two opponents inside the six-yard box and he scored with a first-time shot.
- Nations League on ESPN: Stream LIVE games, replays (U.S. only)
Spain have five points from their opening three Group A2 matches to sit two behind leaders Portugal and two ahead of third-placed Czech Republic.
Switzerland have suffered three consecutive losses and are winless in their last five games since qualifying for this year's World Cup.
Spain host the Czechs in Malaga and Switzerland entertain Portugal in Geneva on Sunday.
"It's good to remind people that Switzerland were eight years without losing an official game at home, 23 consecutive games," Spain coach Luis Enrique told TVE.
"Winning away from home is very complicated and I think today we played a serious game, tried to impose our style, we suffered like was expected due to the level of our opponent, but I'm really happy with the outcome."
Luis Enrique made eight changes in the starting team that struggled to a 2-2 draw with the Czech Republic last time out.
Llorente and Sarabia were the main focus of Spain's attack with their pace, fed by precise passes from teenager Gavi behind the Swiss line.
Spain enjoyed almost 70% of possession, but forwards Alvaro Morata and Ferran Torres lacked the precision to make it pay.
Switzerland only managed one shot on target in the entire game but were almost gifted an equaliser as Spain made two late blunders.
Goalkeeper Unai Simon left his box to try to make a clearance but missed the ball and was lucky Breel Embolo placed his shot wide of an empty goal before Haris Seferovic had a shot blocked by Pau Torres.
"We needed to win and we got three valuable points to be in contention," Sarabia said. "I'm happy with the three games we've played so far even though we drew our opening two games.
"The good thing about this team is that we always want more. We have a clear idea of our style of play but at times we depend on what our rivals do."