But just over half an hour into the game at the Al Thumama Stadium, the Costa Ricans had already been blown away and were 3-0 down after goals from Dani Olmo, Marco Asensio and a Ferran Torres penalty.
Luis Enrique gave some of his first-choice players a rest in the second half before their next game on Sunday against Germany who will be desperate for a win after their shock defeat by Japan earlier on Wednesday.
Unfortunately for Costa Rica, the changes did nothing to slow Spain’s rhythm with substitute Alvaro Morata - edged out of the starting side by Marco Asensio - teeing up 18-year-old Gavi’s fine volley before scoring in injury time himself.
A second goal for Torres early in the second half and one for another substitute, Carlos Soler, had already put Spain far out of sight as they racked up their biggest ever win at the World Cup.
Several members of Spain’s youthful side - their squad is the joint third youngest in Qatar - had already proved their abilities last year when they were knocked out of the Euros at the semi-finals on penalties.
The addition of Gavi, who at 18 is the youngest player to appear for the national side at a World Cup, and others such as Barcelona teammate Ansu Fati, suggest that Luis Enrique is building a new European powerhouse.
Olmos, who got the goals flowing, dismissed suggestions that the result reflected a lack of competitiveness by Costa Rica who fielded several veterans of past campaigns.
“I don’t think it was a question of Costa Rica being bad. It was about our team being strong,” Olmos told reporters.
“I think the win was what we were due. We deserved to win after taking the game to them. I think our team is strong and that is the path that we need to follow. It was a confidence boost for sure.”