Spain went in front in Malaga after 24 minutes when a perfectly-weighted pass by Marco Asensio released Carlos Soler to score.
Pablo Sarabia added the second on 75 minutes as Spain got the better of a Czech side against whom they had drawn 2-2 in Prague last week.
Despite the win, Spain were indebted to some fine saves by Athletic Bilbao goalkeeper Unai Simon.
He thwarted an 18th-minute strike from Vaclav Cerny and, two minutes later, denied Jan Kuchta.
In Geneva, Switzerland took the lead after just 57 seconds against a Portugal side playing without Cristiano Ronaldo when Haris Seferovic scored from Silvan Widmer’s pass.
Portugal’s stand-in skipper Pepe made his 128th international appearance and they were unlucky not to get something from the game with Swiss keeper Jonas Omlin saving from Danilo and Bernardo Silva.
Victory was a welcome boost for a Swiss side who went into the game having lost their previous three matches.
Spain stay top of League A Group 2 with eight points from four games with Portugal a point further back.
Erling Haaland scored twice and set up the third as Norway beat neighbours Sweden 3-2 in Oslo in League B.
“I’m speechless!” the 21-year-old striker told Norwegian television, before adding: “To win against Sweden in the last match of the season, it’s beautiful.”
Haaland, who is heading for Manchester City from Borussia Dortmund this summer, gave Norway the lead in the 10th minute heading in a near-post cross.
He added a penalty in the 54th minute after Hjalmar Ekdal fouled Alexander Sorloth.
It was Haaland’s 20th international goals in 18 Norway appearances.
Sweden replied eight minutes later when Emil Forsberg smashed home a pass from Dejan Kulusevski.
Haaland then crossed for Sorloth to head home and restore the host’s two-goal lead after 77 minutes.
Viktor Gyokeres gave the Swedes brief hope by rifling home a shot five minutes into added time.
“This tasted great,” said Norway coach Stale Solbakken.