Dani Olmo got the goals flowing in the 11th minute when he exchanged passes with Gavi and chipped Costa Rica goalkeeper Keylor Navas. Ten minutes later, Marco Asensio timed a run into the box perfectly to connect powerfully with a Jordi Alba cross.

Torres stroked home his penalty in the 31st minute and the Barcelona winger claimed his second in the 54th when he took advantage of hesitant defending.

Gavi, the youngest player to represent Spain at a World Cup, struck with a perfectly hit volley in the 74th minute before substitutes Carlos Soler and Alvaro Morata rounded off a totally one-sided encounter.